# HG changeset patch # User Christian Hammond # Date 1077090201 0 # Node ID ef881489396e425f9faa7f59243ef215bc8af19e # Parent 89d9d004e3f34915aac9deb84aad08dd52fc3517 [gaim-migrate @ 9011] Another patch from Scott Lamb to change g_source_remove calls to gaim_timeout_remove. It also implements gaim_timeout_remove. committer: Tailor Script diff -r 89d9d004e3f3 -r ef881489396e src/account.c --- a/src/account.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/account.c Wed Feb 18 07:43:21 2004 +0000 @@ -1659,7 +1659,7 @@ gaim_accounts_uninit(void) { if (accounts_save_timer != 0) { - g_source_remove(accounts_save_timer); + gaim_timeout_remove(accounts_save_timer); accounts_save_timer = 0; gaim_accounts_sync(); } diff -r 89d9d004e3f3 -r ef881489396e src/blist.c --- a/src/blist.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/blist.c Wed Feb 18 07:43:21 2004 +0000 @@ -296,7 +296,7 @@ if(do_something) { if(buddy->timer > 0) - g_source_remove(buddy->timer); + gaim_timeout_remove(buddy->timer); buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); gaim_contact_compute_priority_buddy(gaim_buddy_get_contact(buddy)); @@ -1103,7 +1103,7 @@ g_free(hb.name); if(buddy->timer > 0) - g_source_remove(buddy->timer); + gaim_timeout_remove(buddy->timer); if (buddy->icon != NULL) gaim_buddy_icon_unref(buddy->icon); diff -r 89d9d004e3f3 -r ef881489396e src/connection.c --- a/src/connection.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/connection.c Wed Feb 18 07:43:21 2004 +0000 @@ -87,7 +87,7 @@ g_free(gc->away_state); if (gc->disconnect_timeout) - g_source_remove(gc->disconnect_timeout); + gaim_timeout_remove(gc->disconnect_timeout); g_free(gc); } diff -r 89d9d004e3f3 -r ef881489396e src/conversation.c --- a/src/conversation.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/conversation.c Wed Feb 18 07:43:21 2004 +0000 @@ -1592,7 +1592,7 @@ if (im->typing_timeout == 0) return; - g_source_remove(im->typing_timeout); + gaim_timeout_remove(im->typing_timeout); im->typing_timeout = 0; } @@ -1637,7 +1637,7 @@ if (im->type_again_timeout == 0) return; - g_source_remove(im->type_again_timeout); + gaim_timeout_remove(im->type_again_timeout); im->type_again_timeout = 0; } diff -r 89d9d004e3f3 -r ef881489396e src/eventloop.c --- a/src/eventloop.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/eventloop.c Wed Feb 18 07:43:21 2004 +0000 @@ -34,6 +34,14 @@ return ops->timeout_add(interval, function, data); } +void +gaim_timeout_remove(guint tag) +{ + GaimEventLoopUiOps *ops = gaim_eventloop_get_ui_ops(); + + return ops->timeout_remove(tag); +} + guint gaim_input_add(int source, GaimInputCondition condition, GaimInputFunction func, gpointer user_data) { diff -r 89d9d004e3f3 -r ef881489396e src/eventloop.h --- a/src/eventloop.h Wed Feb 18 07:22:53 2004 +0000 +++ b/src/eventloop.h Wed Feb 18 07:43:21 2004 +0000 @@ -54,6 +54,12 @@ guint (*timeout_add)(guint interval, GSourceFunc function, gpointer data); /** + * Removes a callback timer. + * @see gaim_timeout_remove, g_source_remove + */ + guint (*timeout_remove)(guint handle); + + /** * Adds an input handler. * @see gaim_input_add, g_io_add_watch_full */ @@ -83,6 +89,13 @@ guint gaim_timeout_add(guint interval, GSourceFunc function, gpointer data); /** + * Removes a timeout handler. + * + * @param handle The handle, as returned by gaim_timeout_add. + */ +void gaim_timeout_remove(guint handle); + +/** * Adds an input handler. * * @param fd The input file descriptor. diff -r 89d9d004e3f3 -r ef881489396e src/gaim-disclosure.c --- a/src/gaim-disclosure.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/gaim-disclosure.c Wed Feb 18 07:43:21 2004 +0000 @@ -188,7 +188,7 @@ gboolean opening) { if (disclosure->priv->expand_id > 0) { - g_source_remove(disclosure->priv->expand_id); + gaim_timeout_remove(disclosure->priv->expand_id); } disclosure->priv->direction = opening ? 1 : -1; diff -r 89d9d004e3f3 -r ef881489396e src/gtkeventloop.c --- a/src/gtkeventloop.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/gtkeventloop.c Wed Feb 18 07:43:21 2004 +0000 @@ -92,19 +92,12 @@ return closure->result; } -static void gaim_gtk_input_remove(guint tag) -{ - /* gaim_debug(GAIM_DEBUG_MISC, "proxy", - "CLOSURE: removing input watcher %d\n", tag); */ - if (tag > 0) - g_source_remove(tag); -} - static GaimEventLoopUiOps eventloop_ops = { g_timeout_add, + g_source_remove, gaim_gtk_input_add, - gaim_gtk_input_remove + g_source_remove }; GaimEventLoopUiOps * diff -r 89d9d004e3f3 -r ef881489396e src/gtkroomlist.c --- a/src/gtkroomlist.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/gtkroomlist.c Wed Feb 18 07:43:21 2004 +0000 @@ -79,7 +79,7 @@ if (dialog->roomlist) { if (dialog->pg_to_active) { - g_source_remove(dialog->pg_update_to); + gaim_timeout_remove(dialog->pg_update_to); dialog->pg_to_active = FALSE; /* yes, that's right, unref it twice. */ gaim_roomlist_unref(dialog->roomlist); diff -r 89d9d004e3f3 -r ef881489396e src/pounce.c --- a/src/pounce.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/pounce.c Wed Feb 18 07:43:21 2004 +0000 @@ -1008,7 +1008,7 @@ gaim_pounces_uninit() { if (pounces_save_timer != 0) { - g_source_remove(pounces_save_timer); + gaim_timeout_remove(pounces_save_timer); pounces_save_timer = 0; gaim_pounces_sync(); } diff -r 89d9d004e3f3 -r ef881489396e src/prefs.c --- a/src/prefs.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/prefs.c Wed Feb 18 07:43:21 2004 +0000 @@ -135,7 +135,7 @@ gaim_prefs_uninit() { if (prefs_save_timer != 0) { - g_source_remove(prefs_save_timer); + gaim_timeout_remove(prefs_save_timer); prefs_save_timer = 0; gaim_prefs_sync(); } diff -r 89d9d004e3f3 -r ef881489396e src/protocols/icq/gaim_icq.c --- a/src/protocols/icq/gaim_icq.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/protocols/icq/gaim_icq.c Wed Feb 18 07:43:21 2004 +0000 @@ -148,7 +148,7 @@ if (interval > 0 && ack_timer == 0) ack_timer = gaim_timeout_add(interval * 1000, icq_set_timeout_cb, NULL); else if (ack_timer > 0) { - g_source_remove(ack_timer); + gaim_timeout_remove(ack_timer); ack_timer = 0; } } diff -r 89d9d004e3f3 -r ef881489396e src/protocols/irc/irc.c --- a/src/protocols/irc/irc.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/protocols/irc/irc.c Wed Feb 18 07:43:21 2004 +0000 @@ -270,12 +270,12 @@ irc_cmd_quit(irc, "quit", NULL, NULL); if (gc->inpa) - g_source_remove(gc->inpa); + gaim_timeout_remove(gc->inpa); g_free(irc->inbuf); close(irc->fd); if (irc->timer) - g_source_remove(irc->timer); + gaim_timeout_remove(irc->timer); g_hash_table_destroy(irc->cmds); g_hash_table_destroy(irc->msgs); if (irc->motd) diff -r 89d9d004e3f3 -r ef881489396e src/protocols/msn/httpmethod.c --- a/src/protocols/msn/httpmethod.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/protocols/msn/httpmethod.c Wed Feb 18 07:43:21 2004 +0000 @@ -67,7 +67,7 @@ if (servconn->http_data->timer) { gaim_debug(GAIM_DEBUG_INFO, "msn", "Stopping timer\n"); - g_source_remove(servconn->http_data->timer); + gaim_timeout_remove(servconn->http_data->timer); servconn->http_data->timer = 0; } } diff -r 89d9d004e3f3 -r ef881489396e src/protocols/msn/servconn.c --- a/src/protocols/msn/servconn.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/protocols/msn/servconn.c Wed Feb 18 07:43:21 2004 +0000 @@ -280,7 +280,7 @@ g_free(servconn->http_data->gateway_ip); if (servconn->http_data->timer) - g_source_remove(servconn->http_data->timer); + gaim_timeout_remove(servconn->http_data->timer); g_free(servconn->http_data); } diff -r 89d9d004e3f3 -r ef881489396e src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/protocols/oscar/oscar.c Wed Feb 18 07:43:21 2004 +0000 @@ -790,9 +790,9 @@ if (od->icopa > 0) gaim_input_remove(od->icopa); if (od->icontimer > 0) - g_source_remove(od->icontimer); + gaim_timeout_remove(od->icontimer); if (od->getblisttimer) - g_source_remove(od->getblisttimer); + gaim_timeout_remove(od->getblisttimer); aim_session_kill(od->sess); g_free(od->sess); od->sess = NULL; @@ -1463,7 +1463,7 @@ od->iconconnecting = FALSE; if (od->icontimer) - g_source_remove(od->icontimer); + gaim_timeout_remove(od->icontimer); od->icontimer = gaim_timeout_add(100, gaim_icon_timerfunc, gc); return 1; @@ -1882,7 +1882,7 @@ if (!cur) { od->requesticon = g_slist_append(od->requesticon, g_strdup(gaim_normalize(gc->account, info->sn))); if (od->icontimer) - g_source_remove(od->icontimer); + gaim_timeout_remove(od->icontimer); od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); } } @@ -3496,7 +3496,7 @@ free(sn); if (od->icontimer) - g_source_remove(od->icontimer); + gaim_timeout_remove(od->icontimer); od->icontimer = gaim_timeout_add(500, gaim_icon_timerfunc, gc); return 1; @@ -3544,7 +3544,7 @@ } if (od->icontimer) - g_source_remove(od->icontimer); + gaim_timeout_remove(od->icontimer); od->icontimer = gaim_timeout_add(250, gaim_icon_timerfunc, gc); return 1; diff -r 89d9d004e3f3 -r ef881489396e src/protocols/zephyr/zephyr.c --- a/src/protocols/zephyr/zephyr.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/protocols/zephyr/zephyr.c Wed Feb 18 07:43:21 2004 +0000 @@ -797,10 +797,10 @@ g_slist_free(subscrips); if (nottimer) - g_source_remove(nottimer); + gaim_timeout_remove(nottimer); nottimer = 0; if (loctimer) - g_source_remove(loctimer); + gaim_timeout_remove(loctimer); loctimer = 0; zgc = NULL; z_call(ZCancelSubscriptions(0)); diff -r 89d9d004e3f3 -r ef881489396e src/server.c --- a/src/server.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/server.c Wed Feb 18 07:43:21 2004 +0000 @@ -90,7 +90,7 @@ gc->keep_alive = gaim_timeout_add(60000, send_keepalive, gc); } else if (!on && gc->keep_alive > 0) { gaim_debug(GAIM_DEBUG_INFO, "server", "removing NOP\n"); - g_source_remove(gc->keep_alive); + gaim_timeout_remove(gc->keep_alive); gc->keep_alive = 0; } } @@ -108,7 +108,7 @@ } if (gc->idle_timer > 0) - g_source_remove(gc->idle_timer); + gaim_timeout_remove(gc->idle_timer); gc->idle_timer = 0; update_keepalive(gc, FALSE); @@ -152,7 +152,7 @@ } if (gc->idle_timer > 0) - g_source_remove(gc->idle_timer); + gaim_timeout_remove(gc->idle_timer); gc->idle_timer = gaim_timeout_add(20000, check_idle, gc); serv_touch_idle(gc); diff -r 89d9d004e3f3 -r ef881489396e src/win32/win32dep.c --- a/src/win32/win32dep.c Wed Feb 18 07:22:53 2004 +0000 +++ b/src/win32/win32dep.c Wed Feb 18 07:43:21 2004 +0000 @@ -128,7 +128,7 @@ WGAIM_FLASH_INFO *finfo = data; /* Stop flashing and remove filter */ gaim_debug(GAIM_DEBUG_INFO, "wgaim", "Removing timeout\n"); - g_source_remove(finfo->t_handle); + gaim_timeout_remove(finfo->t_handle); gaim_debug(GAIM_DEBUG_INFO, "wgaim", "Disconnecting signal handler\n"); g_signal_handler_disconnect(G_OBJECT(widget),finfo->sig_handler); gaim_debug(GAIM_DEBUG_INFO, "wgaim", "done\n");