Skip to contentSkip to conversation

replace g_timeout_add with g_timeout_add_seconds

bluez-gnome/proximity Baptiste Mille-Mathias 2 participants 2 messages Dec 19, 2008 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

Hello,

Please find attached a patch to replace the usage of g_timeout_add with g_timeout_add_seconds in the proximity application in bluez-gnome. g_timeout_add_seconds does less wake up, ans so saves a little bit of power.

Could someone review it and commit it?

thanks a lot.

Cheers.

Signature · 1 line
Baptiste Mille-Mathias <[email protected]>
proximity/main.c +4 -4
index d295be5..71e9128 100644
@@ -80,7 +80,7 @@ static void clicked_callback(GtkWidget *button, gpointer user_data)
 	if (error != NULL) {
 		gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0,
 							error->message);
-		g_timeout_add(3000, message_remove, NULL);
+		g_timeout_add_seconds(3, message_remove, NULL);
 		g_error_free(error);
 	}
 }
@@ -100,7 +100,7 @@ static void cancel_callback(GtkWidget *button, gpointer user_data)
 	if (error != NULL) {
 		gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0,
 							error->message);
-		g_timeout_add(3000, message_remove, NULL);
+		g_timeout_add_seconds(3, message_remove, NULL);
 		g_error_free(error);
 	}
 }
@@ -127,7 +127,7 @@ static void periodic_callback(GtkWidget *widget, gpointer user_data)
 		if (error != NULL) {
 			gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0,
 							error->message);
-			g_timeout_add(3000, message_remove, NULL);
+			g_timeout_add_seconds(3, message_remove, NULL);
 			g_error_free(error);
 
 			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
@@ -140,7 +140,7 @@ static void periodic_callback(GtkWidget *widget, gpointer user_data)
 		if (error != NULL) {
 			gtk_statusbar_push(GTK_STATUSBAR(statusbar), 0,
 							error->message);
-			g_timeout_add(3000, message_remove, NULL);
+			g_timeout_add_seconds(3, message_remove, NULL);
 			g_error_free(error);
 
 			gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(widget),
maintainer
#1 lore raw

Hi Baptiste,

Quoted 4 lines

Please find attached a patch to replace the usage of g_timeout_add with g_timeout_add_seconds in the proximity application in bluez-gnome. g_timeout_add_seconds does less wake up, ans so saves a little bit of power.

patch has been applied. Thanks.

Regards

Marcel