comparison plugins/idle.c @ 12839:2bf82fdddf5e

[gaim-migrate @ 15187] Signal handlers are connected in plugin_load, not init_plugin. committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Thu, 12 Jan 2006 01:26:51 +0000
parents 74eb10cead7f
children 890c6429bc61
comparison
equal deleted inserted replaced
12838:cb36bc2db7c5 12839:2bf82fdddf5e
263 l = g_list_append(l, act); 263 l = g_list_append(l, act);
264 264
265 return l; 265 return l;
266 } 266 }
267 267
268 static void
269 signing_off_cb(GaimConnection *gc, void *data)
270 {
271 GaimAccount *account;
272
273 account = gaim_connection_get_account(gc);
274 idled_accts = g_list_remove(idled_accts, account);
275 }
276
277 static gboolean
278 plugin_load(GaimPlugin *plugin)
279 {
280 gaim_signal_connect(gaim_connections_get_handle(), "signing-off",
281 plugin,
282 GAIM_CALLBACK(signing_off_cb), NULL);
283 }
284
268 static gboolean 285 static gboolean
269 plugin_unload(GaimPlugin *plugin) 286 plugin_unload(GaimPlugin *plugin)
270 { 287 {
271 unidle_all_action(NULL); 288 unidle_all_action(NULL);
272 289
288 VERSION, 305 VERSION,
289 N_("Allows you to hand-configure how long you've been idle"), 306 N_("Allows you to hand-configure how long you've been idle"),
290 N_("Allows you to hand-configure how long you've been idle"), 307 N_("Allows you to hand-configure how long you've been idle"),
291 "Eric Warmenhoven <eric@warmenhoven.org>", 308 "Eric Warmenhoven <eric@warmenhoven.org>",
292 GAIM_WEBSITE, 309 GAIM_WEBSITE,
293 NULL, 310 plugin_load,
294 plugin_unload, 311 plugin_unload,
295 NULL, 312 NULL,
296 NULL, 313 NULL,
297 NULL, 314 NULL,
298 NULL, 315 NULL,
299 actions 316 actions
300 }; 317 };
301 318
302 static void 319 static void
303 signing_off_cb(GaimConnection *gc, void *data)
304 {
305 GaimAccount *account;
306
307 account = gaim_connection_get_account(gc);
308 idled_accts = g_list_remove(idled_accts, account);
309 }
310
311 static void
312 init_plugin(GaimPlugin *plugin) 320 init_plugin(GaimPlugin *plugin)
313 { 321 {
314 gaim_signal_connect(gaim_connections_get_handle(), "signing-off",
315 plugin,
316 GAIM_CALLBACK(signing_off_cb), NULL);
317 } 322 }
318 323
319 324
320 GAIM_INIT_PLUGIN(idle, init_plugin, info) 325 GAIM_INIT_PLUGIN(idle, init_plugin, info)
321 326