]> www.fi.muni.cz Git - evince.git/commitdiff
Do not jump to the first page when reloading a document from the last
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 3 Sep 2007 15:45:56 +0000 (15:45 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Mon, 3 Sep 2007 15:45:56 +0000 (15:45 +0000)
2007-09-03  Carlos Garcia Campos  <carlosgc@gnome.org>
* shell/ev-window.c: (setup_document_from_metadata),
(ev_window_load_job_cb), (ev_window_cmd_view_reload):
Do not jump to the first page when reloading a document from the
last page.

svn path=/trunk/; revision=2658

ChangeLog
shell/ev-window.c

index 7403976979337ec50080dd99c2ceccc36ba67ef3..83079f68f2f6f21100c4cd638d40f458f9cc0d5f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-09-03  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * shell/ev-window.c: (setup_document_from_metadata),
+       (ev_window_load_job_cb), (ev_window_cmd_view_reload):
+
+       Do not jump to the first page when reloading a document from the
+       last page.
+       
 2007-09-03  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-window.c: (update_chrome_flag),
index c973f42810d1a61ce0f4eb46758f9e0f3c7036eb..25ee9c9dfe85eb199437134aad1b360593953a2c 100644 (file)
@@ -176,6 +176,7 @@ struct _EvWindowPrivate {
        char *local_uri;
        EvLinkDest *dest;
        gboolean unlink_temp_file;
+       gboolean in_reload;
        
        EvDocument *document;
        EvHistory *history;
@@ -796,7 +797,7 @@ setup_document_from_metadata (EvWindow *window)
        if (uri && ev_metadata_manager_get (uri, "page", &page, TRUE)) {
                n_pages = ev_page_cache_get_n_pages (window->priv->page_cache);
                new_page = CLAMP (g_value_get_int (&page), 0, n_pages - 1);
-               if (new_page == n_pages - 1)
+               if (!window->priv->in_reload && new_page == n_pages - 1)
                        new_page = 0;
                ev_page_cache_set_current_page (window->priv->page_cache,
                                                new_page);
@@ -1324,7 +1325,8 @@ ev_window_load_job_cb  (EvJobLoad *job,
                                break;
                }
 
-               ev_window_clear_load_job (ev_window);           
+               ev_window_clear_load_job (ev_window);
+               ev_window->priv->in_reload = FALSE;
                return;
        }
 
@@ -1348,6 +1350,7 @@ ev_window_load_job_cb  (EvJobLoad *job,
                                        _("Unable to open document"),
                                        job->error);
                ev_window_clear_load_job (ev_window);
+               ev_window->priv->in_reload = FALSE;
        }       
 
        return;
@@ -3308,6 +3311,8 @@ ev_window_cmd_view_reload (GtkAction *action, EvWindow *ev_window)
 {
        gchar *uri;
 
+       ev_window->priv->in_reload = TRUE;
+       
        uri = g_strdup (ev_window->priv->uri);
        ev_window_open_uri (ev_window, uri, NULL, 0, FALSE, NULL);
        g_free (uri);