changeset 18005:a6aad36ca735

The second_add_timeout patch from Arjan.
author Richard Laager <rlaager@wiktel.com>
date Sat, 19 May 2007 21:28:41 +0000
parents d39a4d3f7750
children f2d8658b3a86
files gtk/gtkeventloop.c libgaim/account.c libgaim/blist.c libgaim/connection.c libgaim/conversation.c libgaim/eventloop.c libgaim/eventloop.h libgaim/idle.c libgaim/pounce.c libgaim/prefs.c libgaim/savedstatuses.c libgaim/server.c
diffstat 12 files changed, 23 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkeventloop.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/gtk/gtkeventloop.c	Sat May 19 21:28:41 2007 +0000
@@ -116,6 +116,7 @@
 static GaimEventLoopUiOps eventloop_ops =
 {
 	g_timeout_add,
+	NULL,
 	(guint (*)(guint))g_source_remove,
 	gaim_gtk_input_add,
 	(guint (*)(guint))g_source_remove
--- a/libgaim/account.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/account.c	Sat May 19 21:28:41 2007 +0000
@@ -415,7 +415,7 @@
 schedule_accounts_save()
 {
 	if (save_timer == 0)
-		save_timer = gaim_timeout_add(5000, save_cb, NULL);
+		save_timer = gaim_timeout_add_seconds(5, save_cb, NULL);
 }
 
 
--- a/libgaim/blist.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/blist.c	Sat May 19 21:28:41 2007 +0000
@@ -365,7 +365,7 @@
 gaim_blist_schedule_save()
 {
 	if (save_timer == 0)
-		save_timer = gaim_timeout_add(5000, save_cb, NULL);
+		save_timer = gaim_timeout_add_seconds(5, save_cb, NULL);
 }
 
 
--- a/libgaim/connection.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/connection.c	Sat May 19 21:28:41 2007 +0000
@@ -72,7 +72,7 @@
 	if (on && !gc->keepalive)
 	{
 		gaim_debug_info("connection", "Activating keepalive.\n");
-		gc->keepalive = gaim_timeout_add(30000, send_keepalive, gc);
+		gc->keepalive = gaim_timeout_add_seconds(30, send_keepalive, gc);
 	}
 	else if (!on && gc->keepalive > 0)
 	{
--- a/libgaim/conversation.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/conversation.c	Sat May 19 21:28:41 2007 +0000
@@ -1008,7 +1008,7 @@
 	conv = gaim_conv_im_get_conversation(im);
 	name = gaim_conversation_get_name(conv);
 
-	im->typing_timeout = gaim_timeout_add(timeout * 1000, reset_typing_cb, conv);
+	im->typing_timeout = gaim_timeout_add_seconds(timeout, reset_typing_cb, conv);
 }
 
 void
--- a/libgaim/eventloop.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/eventloop.c	Sat May 19 21:28:41 2007 +0000
@@ -35,6 +35,17 @@
 }
 
 guint
+gaim_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data)
+{
+	GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops();
+
+	if (ops->timeout_add_seconds)
+		return ops->timeout_add_seconds(interval, function, data);
+	else
+		return ops->timeout_add(1000 * interval, function, data);
+}
+
+guint
 gaim_timeout_remove(guint tag)
 {
 	GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops();
--- a/libgaim/eventloop.h	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/eventloop.h	Sat May 19 21:28:41 2007 +0000
@@ -52,6 +52,7 @@
 	 * @see g_timeout_add, gaim_timeout_add
 	 **/
 	guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data);
+	guint (*timeout_add_seconds)(guint interval, GSourceFunc function, gpointer data);
 
 	/**
 	 * Removes a callback timer.
@@ -89,6 +90,7 @@
  *         gaim_timeout_remove to remove the timer.
  */
 guint gaim_timeout_add(guint interval, GSourceFunc function, gpointer data);
+guint gaim_timeout_add_seconds(guint interval, GSourceFunc function, gpointer data);
 
 /**
  * Removes a timeout handler.
--- a/libgaim/idle.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/idle.c	Sat May 19 21:28:41 2007 +0000
@@ -241,7 +241,7 @@
 gaim_idle_init()
 {
 	/* Add the timer to check if we're idle */
-	idle_timer = gaim_timeout_add(IDLE_CHECK_INTERVAL * 1000, check_idleness, NULL);
+	idle_timer = gaim_timeout_add_seconds(IDLE_CHECK_INTERVAL , check_idleness_timer, NULL);
 
 	gaim_signal_connect(gaim_conversations_get_handle(), "sent-im-msg",
 						gaim_idle_get_handle(),
--- a/libgaim/pounce.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/pounce.c	Sat May 19 21:28:41 2007 +0000
@@ -273,7 +273,7 @@
 schedule_pounces_save(void)
 {
 	if (save_timer == 0)
-		save_timer = gaim_timeout_add(5000, save_cb, NULL);
+		save_timer = gaim_timeout_add_seconds(5, save_cb, NULL);
 }
 
 
--- a/libgaim/prefs.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/prefs.c	Sat May 19 21:28:41 2007 +0000
@@ -217,7 +217,7 @@
 schedule_prefs_save(void)
 {
 	if (save_timer == 0)
-		save_timer = gaim_timeout_add(5000, save_cb, NULL);
+		save_timer = gaim_timeout_add_seconds(5, save_cb, NULL);
 }
 
 
--- a/libgaim/savedstatuses.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/savedstatuses.c	Sat May 19 21:28:41 2007 +0000
@@ -357,7 +357,7 @@
 schedule_save(void)
 {
 	if (save_timer == 0)
-		save_timer = gaim_timeout_add(5000, save_cb, NULL);
+		save_timer = gaim_timeout_add_seconds(5, save_cb, NULL);
 }
 
 
--- a/libgaim/server.c	Fri Jan 19 04:14:46 2007 +0000
+++ b/libgaim/server.c	Sat May 19 21:28:41 2007 +0000
@@ -89,7 +89,7 @@
 
 	/* because we're modifying or creating a lar, schedule the
 	 * function to expire them as the pref dictates */
-	gaim_timeout_add((SECS_BEFORE_RESENDING_AUTORESPONSE + 1) * 1000, expire_last_auto_responses, NULL);
+	gaim_timeout_add_seconds((SECS_BEFORE_RESENDING_AUTORESPONSE + 1), expire_last_auto_responses, NULL);
 
 	tmp = last_auto_responses;