+2006-06-09 Pat Rondon <pmr@patrondon.org>
+
+ * shell/ev-jobs.c: (ev_job_xfer_run):
+ * shell/ev-window.c: (password_dialog_response),
+ (ev_window_popup_password_dialog), (ev_window_xfer_job_cb),
+ (ev_window_dispose):
+ Fixes bug #344160: if the xfer job doesn't complete
+ because a password is required, reload the existing
+ instance instead of creating a new one.
+
2006-06-01 Nickolay V. Shmyrev <<nshmyrev@yandex.ru>>
* shell/main.c: (main): Call gdk_threads_init. Thus
g_error_free (job->error);
job->error = NULL;
}
+
+ /* This job may already have a document even if the job didn't complete
+ because, e.g., a password is required - if so, just reload rather than
+ creating a new instance */
+ if (EV_JOB (job)->document) {
+ ev_document_load (EV_JOB (job)->document,
+ job->local_uri ? job->local_uri : job->uri,
+ &job->error);
+ EV_JOB (job)->finished = TRUE;
+ return;
+ }
source_uri = gnome_vfs_uri_new (job->uri);
if (!gnome_vfs_uri_is_local (source_uri) && !job->local_uri) {
EvLinkDest *dest;
EvDocument *document;
- EvDocument *password_document;
+
EvPageCache *page_cache;
EvWindowPageMode page_mode;
EvWindowTitle *title;
password = ev_password_dialog_get_password (EV_PASSWORD_DIALOG (password_dialog));
if (password) {
ev_document_doc_mutex_lock ();
- ev_document_security_set_password (EV_DOCUMENT_SECURITY (ev_window->priv->password_document),
+ ev_document_security_set_password (EV_DOCUMENT_SECURITY (ev_window->priv->xfer_job->document),
password);
ev_document_doc_mutex_unlock ();
}
ev_password_dialog_save_password (EV_PASSWORD_DIALOG (password_dialog));
- g_object_unref (ev_window->priv->password_document);
- ev_window->priv->password_document = NULL;
-
ev_window_title_set_type (ev_window->priv->title, EV_WINDOW_TITLE_DOCUMENT);
ev_job_queue_add_job (ev_window->priv->xfer_job, EV_JOB_PRIORITY_HIGH);
static void
ev_window_popup_password_dialog (EvWindow *ev_window)
{
- g_assert (ev_window->priv->password_document);
+ g_assert (ev_window->priv->xfer_job);
gtk_widget_set_sensitive (ev_window->priv->password_view, FALSE);
ev_view_set_loading (EV_VIEW (ev_window->priv->view), FALSE);
- if (ev_window->priv->password_document) {
- g_object_unref (ev_window->priv->password_document);
- ev_window->priv->password_document = NULL;
- }
-
/* Success! */
if (job->error == NULL) {
ev_window->priv->uri = g_strdup (job->uri);
setup_view_from_metadata (ev_window);
- ev_window->priv->password_document = g_object_ref (document);
file_name = gnome_vfs_format_uri_for_display (job->uri);
base_name = g_path_get_basename (file_name);
if (priv->local_uri) {
ev_window_clear_local_uri (window);
}
-
- if (priv->password_document) {
- g_object_unref (priv->password_document);
- priv->password_document = NULL;
- }
ev_window_close_dialogs (window);