public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [bluez-gnome/proximity] replace g_timeout_add with g_timeout_add_seconds
Date: Fri, 19 Dec 2008 12:27:12 +0100	[thread overview]
Message-ID: <1229686032.6392.4.camel@oak> (raw)

[-- Attachment #1: Type: text/plain, Size: 350 bytes --]

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.

-- 
Baptiste Mille-Mathias <baptiste.millemathias@gmail.com>

[-- Attachment #2: bluez-gnome_565084.diff --]
[-- Type: text/x-patch, Size: 1504 bytes --]

diff --git a/proximity/main.c b/proximity/main.c
index d295be5..71e9128 100644
--- a/proximity/main.c
+++ b/proximity/main.c
@@ -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),

             reply	other threads:[~2008-12-19 11:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-19 11:27 Baptiste Mille-Mathias [this message]
2008-12-19 18:50 ` [bluez-gnome/proximity] replace g_timeout_add with g_timeout_add_seconds Marcel Holtmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1229686032.6392.4.camel@oak \
    --to=baptiste.millemathias@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox