]> www.fi.muni.cz Git - evince.git/commitdiff
Use g_timeout_add_seconds instead of g_timeout_add when available.
authorCarlos Garcia Campos <carlosgc@gnome.org>
Sun, 29 Jul 2007 16:10:27 +0000 (16:10 +0000)
committerCarlos Garcia Campos <carlosgc@src.gnome.org>
Sun, 29 Jul 2007 16:10:27 +0000 (16:10 +0000)
2007-07-29  Carlos Garcia Campos  <carlosgc@gnome.org>
* 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

ChangeLog
cut-n-paste/totem-screensaver/totem-scrsaver.c
shell/ev-metadata-manager.c
shell/ev-view.c
shell/ev-window.c

index 18f62ec1364965b979e3594c311afd219cd89b66..3cd135e74b19fc79aa1d5bd9e8e7fc64d7650b82 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-07-29  Carlos Garcia Campos  <carlosgc@gnome.org>
+
+       * 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.
+       
 2007-07-29  Carlos Garcia Campos  <carlosgc@gnome.org>
 
        * shell/ev-sidebar-thumbnails.c: (ev_sidebar_thumbnails_init):
index 1990b0c11b5069978dc5b7d0dabce3693f5fc286..392443043443c69b23d63ac3226ea26c24631529 100644 (file)
@@ -294,11 +294,21 @@ screensaver_disable_x11 (TotemScrsaver *scr)
 
                if (scr->priv->timeout != 0)
                {
+#if GLIB_CHECK_VERSION (2, 13, 0)
+                       g_timeout_add_seconds (scr->priv->timeout / 2,
+                                              (GSourceFunc) fake_event, scr);
+#else
                        g_timeout_add (scr->priv->timeout / 2 * 1000,
-                                       (GSourceFunc) fake_event, scr);
+                                      (GSourceFunc) fake_event, scr);
+#endif
                } else {
-                       g_timeout_add (XSCREENSAVER_MIN_TIMEOUT / 2 * 1000,
+#if GLIB_CHECK_VERSION (2, 13, 0)
+                       g_timeout_add_seconds (XSCREENSAVER_MIN_TIMEOUT / 2,
                                        (GSourceFunc) fake_event, scr);
+#else
+                       g_timeout_add (XSCREENSAVER_MIN_TIMEOUT / 2 * 1000,
+                                      (GSourceFunc) fake_event, scr);
+#endif
                }
 
                return;
index e86da9735834ae10cf64b0ffb037b2cf15e7c420..067ac6ea28712e404f89262744d2ac680ea51e97 100644 (file)
@@ -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
 }
 
 /**
index c4ec8db37d55750883cef72011cb3d0be44a42ab..1f9e82443244757d49c79768872be25be0f3875a 100644 (file)
@@ -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
index 233067b398dfd5214bf591e835374d003bb67646..cdc41ea6a7e05a63f7ddd00c01368a8e7ffe502c 100644 (file)
@@ -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));
 }