+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),
char *local_uri;
EvLinkDest *dest;
gboolean unlink_temp_file;
+ gboolean in_reload;
EvDocument *document;
EvHistory *history;
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);
break;
}
- ev_window_clear_load_job (ev_window);
+ ev_window_clear_load_job (ev_window);
+ ev_window->priv->in_reload = FALSE;
return;
}
_("Unable to open document"),
job->error);
ev_window_clear_load_job (ev_window);
+ ev_window->priv->in_reload = FALSE;
}
return;
{
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);