[balsa] Use g_timeout_add_seconds, save the world



commit 2e67b88abbd78f4747fd2a0a9e85e09ed36b63a4
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Sun Jan 17 19:57:37 2010 -0500

    Use g_timeout_add_seconds, save the world
    
    	* src/balsa-app.c (update_timer): use g_timeout_add_seconds,
    	save the world.

 ChangeLog       |    5 +++++
 src/balsa-app.c |   20 ++++++--------------
 2 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index b062337..3dbde4d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2010-01-17  Peter Bloomfield
 
+	* src/balsa-app.c (update_timer): use g_timeout_add_seconds,
+	save the world.
+
+2010-01-17  Peter Bloomfield
+
 	* src/main-window.c: report NetworkManager state on start-up;
 	skip POP3 checks when disconnected; do not disconnect local IMAP
 	server when NetworkManager is disconnected.
diff --git a/src/balsa-app.c b/src/balsa-app.c
index 11ea18f..4c1c902 100644
--- a/src/balsa-app.c
+++ b/src/balsa-app.c
@@ -487,21 +487,13 @@ check_new_messages_auto_cb(gpointer data)
 void
 update_timer(gboolean update, guint minutes)
 {
-    guint32 timeout;
-    timeout = minutes * 60 * 1000;
+    if (balsa_app.check_mail_timer_id)
+        g_source_remove(balsa_app.check_mail_timer_id);
 
-    if (update) {
-	if (balsa_app.check_mail_timer_id)
-	    g_source_remove(balsa_app.check_mail_timer_id);
-
-        balsa_app.check_mail_timer_id =
-            g_timeout_add(timeout,
-                          (GSourceFunc) check_new_messages_auto_cb, NULL);
-    } else {
-	if (balsa_app.check_mail_timer_id)
-	    g_source_remove(balsa_app.check_mail_timer_id);
-	balsa_app.check_mail_timer_id = 0;
-    }
+    balsa_app.check_mail_timer_id = update ?
+        g_timeout_add_seconds(minutes * 60,
+                              (GSourceFunc) check_new_messages_auto_cb,
+                              NULL) : 0;
 }
 
 



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