[planner] Use g_timeout_add_seconds instead of g_timeout_add



commit ebf088eeaaeae8b0cdc301a2475f384f9820778b
Author: Alexandre Franke <alexandre franke gmail com>
Date:   Thu Jun 9 23:57:56 2011 +0200

    Use g_timeout_add_seconds instead of g_timeout_add
    
    We really don't need subsecond precision in those cases, let's save
    power.

 src/planner-eds-plugin.c       |    4 ++--
 src/planner-gantt-background.c |    6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/src/planner-eds-plugin.c b/src/planner-eds-plugin.c
index 394de7c..4690ee7 100644
--- a/src/planner-eds-plugin.c
+++ b/src/planner-eds-plugin.c
@@ -180,12 +180,12 @@ eds_plugin_busy (PlannerPlugin *plugin,
 			(plugin->priv->glade, "progressbar"));
 
 	if (busy) {
-		gint check_time = 300; /* ms */
+		gint check_time = 1; /* second */
 
 		if (plugin->priv->busy) {
 			return;
 		}
-		plugin->priv->pulse = g_timeout_add (check_time, eds_check_query, plugin);
+		plugin->priv->pulse = g_timeout_add_seconds (check_time, eds_check_query, plugin);
 		cursor = gdk_cursor_new_for_display (gdk_display_get_default (), GDK_WATCH);
 		gtk_widget_set_sensitive
 			(glade_xml_get_widget (plugin->priv->glade, "search_box"), FALSE);
diff --git a/src/planner-gantt-background.c b/src/planner-gantt-background.c
index 4403127..e5e84f6 100644
--- a/src/planner-gantt-background.c
+++ b/src/planner-gantt-background.c
@@ -421,9 +421,9 @@ gantt_background_realize (GnomeCanvasItem *item)
 
 	pango_layout_set_alignment (priv->layout, PANGO_ALIGN_RIGHT);
 
-	priv->timeout_id = g_timeout_add (1000 * 60,
-					  gantt_background_update_timeline,
-					  background);
+	priv->timeout_id = g_timeout_add_seconds (60,
+						  gantt_background_update_timeline,
+						  background);
 }
 
 static void



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