[zenity] Use g_timeout_add_seconds instead g_timeout_add



commit 1570a2bbf07627cb5f8d9828a95db67b7d00634c
Author: Philippe Gauthier <philippe gauthier deuxpi ca>
Date:   Fri Oct 30 14:51:16 2009 -0400

    Use g_timeout_add_seconds instead g_timeout_add
    
    The calls to g_timeout_add are replaced with g_timeout_add_seconds to
    reduce the number or program wake ups. See the GNOME Goal description:
    http://live.gnome.org/GnomeGoals/UseTimeoutAddSeconds

 src/calendar.c      |    2 +-
 src/entry.c         |    2 +-
 src/fileselection.c |    2 +-
 src/msg.c           |    2 +-
 src/notification.c  |    2 +-
 src/progress.c      |    2 +-
 src/scale.c         |    2 +-
 src/text.c          |    2 +-
 src/tree.c          |    2 +-
 9 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/calendar.c b/src/calendar.c
index 8ad53ea..9aaee9f 100644
--- a/src/calendar.c
+++ b/src/calendar.c
@@ -85,7 +85,7 @@ zenity_calendar (ZenityData *data, ZenityCalendarData *cal_data)
   zenity_util_show_dialog (dialog);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   g_object_unref (builder);
diff --git a/src/entry.c b/src/entry.c
index 8826e92..ca53caf 100644
--- a/src/entry.c
+++ b/src/entry.c
@@ -129,7 +129,7 @@ zenity_entry (ZenityData *data, ZenityEntryData *entry_data)
   zenity_util_show_dialog (dialog);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   gtk_main ();
diff --git a/src/fileselection.c b/src/fileselection.c
index dd4ab0d..026bb31 100644
--- a/src/fileselection.c
+++ b/src/fileselection.c
@@ -136,7 +136,7 @@ void zenity_fileselection (ZenityData *data, ZenityFileData *file_data)
   zenity_util_show_dialog (dialog);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   gtk_main ();
diff --git a/src/msg.c b/src/msg.c
index fd92289..1a92875 100644
--- a/src/msg.c
+++ b/src/msg.c
@@ -138,7 +138,7 @@ zenity_msg (ZenityData *data, ZenityMsgData *msg_data)
   zenity_util_show_dialog (dialog);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   g_object_unref (builder);
diff --git a/src/notification.c b/src/notification.c
index 674eaec..99a2e36 100644
--- a/src/notification.c
+++ b/src/notification.c
@@ -292,7 +292,7 @@ zenity_notification (ZenityData *data, ZenityNotificationData *notification_data
   gtk_status_icon_set_visible (status_icon, TRUE);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   gtk_main ();
diff --git a/src/progress.c b/src/progress.c
index 40f9182..4f1f55e 100644
--- a/src/progress.c
+++ b/src/progress.c
@@ -286,7 +286,7 @@ zenity_progress (ZenityData *data, ZenityProgressData *progress_data)
   zenity_progress_read_info (progress_data);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   gtk_main ();
diff --git a/src/scale.c b/src/scale.c
index 8678774..c0d25d1 100644
--- a/src/scale.c
+++ b/src/scale.c
@@ -92,7 +92,7 @@ zenity_scale (ZenityData *data, ZenityScaleData *scale_data)
   zenity_util_show_dialog (dialog);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   g_object_unref (builder);
diff --git a/src/text.c b/src/text.c
index 25bd768..eb5f989 100644
--- a/src/text.c
+++ b/src/text.c
@@ -152,7 +152,7 @@ zenity_text (ZenityData *data, ZenityTextData *text_data)
   g_object_unref (builder);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   gtk_main ();
diff --git a/src/tree.c b/src/tree.c
index 63287e3..3861e86 100644
--- a/src/tree.c
+++ b/src/tree.c
@@ -499,7 +499,7 @@ zenity_tree (ZenityData *data, ZenityTreeData *tree_data)
   zenity_util_show_dialog (dialog);
 
   if(data->timeout_delay > 0) {
-    g_timeout_add (data->timeout_delay * 1000, (GSourceFunc) zenity_util_timeout_handle, NULL);
+    g_timeout_add_seconds (data->timeout_delay, (GSourceFunc) zenity_util_timeout_handle, NULL);
   }
 
   gtk_main ();



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]