From 0de4e4076b4198674b6fa77c8281cd62a293f2fe Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Sun, 29 Jul 2007 16:10:27 +0000 Subject: Use g_timeout_add_seconds instead of g_timeout_add when available. 2007-07-29 Carlos Garcia Campos * cut-n-paste/totem-screensaver/totem-scrsaver.c: (screensaver_disable_x11): * shell/ev-metadata-manager.c: (ev_metadata_arm_timeout): * shell/ev-window.c: (presentation_set_timeout): * shell/ev-view.c: (ev_view_presentation_transition_start): Use g_timeout_add_seconds instead of g_timeout_add when available. svn path=/trunk/; revision=2594 --- (limited to 'shell') diff --git a/shell/ev-metadata-manager.c b/shell/ev-metadata-manager.c index e86da97..067ac6e 100644 --- a/shell/ev-metadata-manager.c +++ b/shell/ev-metadata-manager.c @@ -100,12 +100,21 @@ ev_metadata_arm_timeout(void) { if (ev_metadata_manager->timeout_id) return; +#if GLIB_CHECK_VERSION (2, 13, 5) + ev_metadata_manager->timeout_id = + g_timeout_add_seconds_full (G_PRIORITY_DEFAULT_IDLE, + 2, + (GSourceFunc)ev_metadata_manager_save, + NULL, + NULL); +#else ev_metadata_manager->timeout_id = g_timeout_add_full (G_PRIORITY_DEFAULT_IDLE, 2000, /* 2 sec */ (GSourceFunc)ev_metadata_manager_save, NULL, NULL); +#endif } /** diff --git a/shell/ev-view.c b/shell/ev-view.c index c4ec8db..1f9e824 100644 --- a/shell/ev-view.c +++ b/shell/ev-view.c @@ -4352,10 +4352,19 @@ ev_view_presentation_transition_start (EvView *view) duration = ev_document_transition_get_page_duration (EV_DOCUMENT_TRANSITION (view->document), view->current_page); - if (duration > 0) - view->trans_timeout_id = g_timeout_add (duration * 1000, - (GSourceFunc) transition_next_page, - view); + if (duration > 0) { +#if GLIB_CHECK_VERSION (2, 13, 0) + view->trans_timeout_id = + g_timeout_add_seconds (duration, + (GSourceFunc) transition_next_page, + view); +#else + view->trans_timeout_id = + g_timeout_add (duration * 1000, + (GSourceFunc) transition_next_page, + view); +#endif + } } void diff --git a/shell/ev-window.c b/shell/ev-window.c index 233067b..cdc41ea 100644 --- a/shell/ev-window.c +++ b/shell/ev-window.c @@ -211,7 +211,7 @@ struct _EvWindowPrivate { #define GCONF_LOCKDOWN_SAVE "/desktop/gnome/lockdown/disable_save_to_disk" #define GCONF_LOCKDOWN_PRINT "/desktop/gnome/lockdown/disable_printing" -#define PRESENTATION_TIMEOUT 5 * 1000 +#define PRESENTATION_TIMEOUT 5 #define SIDEBAR_DEFAULT_SIZE 132 #define LINKS_SIDEBAR_ID "links" @@ -2902,9 +2902,16 @@ presentation_set_timeout (EvWindow *window) if (window->priv->presentation_timeout_id > 0) { g_source_remove (window->priv->presentation_timeout_id); } - + +#if GLIB_CHECK_VERSION (2, 13, 0) + window->priv->presentation_timeout_id = + g_timeout_add_seconds (PRESENTATION_TIMEOUT, + (GSourceFunc)presentation_timeout_cb, window); +#else window->priv->presentation_timeout_id = - g_timeout_add (PRESENTATION_TIMEOUT, (GSourceFunc)presentation_timeout_cb, window); + g_timeout_add (PRESENTATION_TIMEOUT * 1000, + (GSourceFunc)presentation_timeout_cb, window); +#endif ev_view_show_cursor (EV_VIEW (window->priv->view)); } -- cgit v0.9.1