+2005-09-08 Marco Pesenti Gritti <mpg@redhat.com>
+
+ * shell/ev-window.c: (page_changed_cb),
+ (setup_document_from_metadata), (update_sidebar_visibility),
+ (setup_view_from_metadata), (ev_window_run_fullscreen),
+ (ev_window_stop_fullscreen), (ev_window_run_presentation),
+ (ev_window_stop_presentation), (ev_window_continuous_changed_cb),
+ (ev_window_dual_mode_changed_cb),
+ (ev_window_sidebar_current_page_changed_cb):
+
+ null check uri before setting and getting metadata
+
2005-09-08 Marco Pesenti Gritti <mpg@redhat.com>
* dvi/Makefile.am:
{
update_action_sensitivity (ev_window);
- ev_metadata_manager_set_int (ev_window->priv->uri, "page", page);
+ if (ev_window->priv->uri) {
+ ev_metadata_manager_set_int (ev_window->priv->uri, "page", page);
+ }
}
static void
GValue page = { 0, };
/* Page */
- if (ev_metadata_manager_get (uri, "page", &page)) {
+ if (uri && ev_metadata_manager_get (uri, "page", &page)) {
ev_page_cache_set_current_page (window->priv->page_cache,
g_value_get_int (&page));
}
char *uri = window->priv->uri;
GValue sidebar_visibility = { 0, };
- if (ev_metadata_manager_get (uri, "sidebar_visibility", &sidebar_visibility)) {
+ if (uri && ev_metadata_manager_get (uri, "sidebar_visibility", &sidebar_visibility)) {
set_widget_visibility (window->priv->sidebar,
g_value_get_boolean (&sidebar_visibility));
}
GValue sidebar_size = { 0, };
GValue sidebar_page = { 0, };
+ if (window->priv->uri == NULL) {
+ return;
+ }
+
/* Window size */
if (!GTK_WIDGET_VISIBLE (window)) {
gboolean restore_size = TRUE;
gtk_window_fullscreen (GTK_WINDOW (window));
ev_window_update_fullscreen_popup (window);
- ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", TRUE);
+ if (window->priv->uri) {
+ ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", TRUE);
+ }
}
static void
update_chrome_visibility (window);
update_sidebar_visibility (window);
- ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", FALSE);
+ if (window->priv->uri) {
+ ev_metadata_manager_set_boolean (window->priv->uri, "fullscreen", FALSE);
+ }
}
static void
update_chrome_visibility (window);
gtk_widget_hide (window->priv->sidebar);
- ev_metadata_manager_set_boolean (window->priv->uri, "presentation", TRUE);
+ if (window->priv->uri) {
+ ev_metadata_manager_set_boolean (window->priv->uri, "presentation", TRUE);
+ }
}
static void
update_chrome_visibility (window);
update_sidebar_visibility (window);
- ev_metadata_manager_set_boolean (window->priv->uri, "presentation", FALSE);
+ if (window->priv->uri) {
+ ev_metadata_manager_set_boolean (window->priv->uri, "presentation", FALSE);
+ }
}
static void
{
ev_window_update_continuous_action (ev_window);
- ev_metadata_manager_set_boolean (ev_window->priv->uri, "continuous",
- ev_view_get_continuous (EV_VIEW (ev_window->priv->view)));
+ if (ev_window->priv->uri) {
+ ev_metadata_manager_set_boolean (ev_window->priv->uri, "continuous",
+ ev_view_get_continuous (EV_VIEW (ev_window->priv->view)));
+ }
}
static void
{
ev_window_update_dual_page_action (ev_window);
- ev_metadata_manager_set_boolean (ev_window->priv->uri, "dual-page",
- ev_view_get_dual_page (EV_VIEW (ev_window->priv->view)));
+ if (ev_window->priv->uri) {
+ ev_metadata_manager_set_boolean (ev_window->priv->uri, "dual-page",
+ ev_view_get_dual_page (EV_VIEW (ev_window->priv->view)));
+ }
}
static char *
g_object_unref (current_page);
- ev_metadata_manager_set_string (ev_window->priv->uri, "sidebar_page", id);
+ if (ev_window->priv->uri) {
+ ev_metadata_manager_set_string (ev_window->priv->uri, "sidebar_page", id);
+ }
}
static void