comparison finch/finch.c @ 19239:829b00936eef

propagate from branch 'im.pidgin.pidgin' (head ee3cab184ee92cf36b4f36013402605653820416) to branch 'im.pidgin.soc.2007.msimprpl' (head 9bcb047516948fbfd4148f735e07e6ea2d96e164)
author Jeffrey Connelly <jaconnel@calpoly.edu>
date Mon, 13 Aug 2007 03:58:49 +0000
parents 8988a205112b
children 098c04602065
comparison
equal deleted inserted replaced
18915:bfc52862d864 19239:829b00936eef
53 { 53 {
54 finch_debug_init(); 54 finch_debug_init();
55 purple_debug_set_ui_ops(finch_debug_get_ui_ops()); 55 purple_debug_set_ui_ops(finch_debug_get_ui_ops());
56 } 56 }
57 57
58 /* XXX: this "leaks" a hashtable on shutdown. I'll let
59 * the finch guys decide if they want to go through the trouble
60 * of properly freeing it, since their quit function doesn't
61 * live in this file */
62
63 static GHashTable *ui_info = NULL; 58 static GHashTable *ui_info = NULL;
64
65 static GHashTable *finch_ui_get_info() 59 static GHashTable *finch_ui_get_info()
66 { 60 {
67 if(NULL == ui_info) { 61 if (ui_info == NULL) {
68 ui_info = g_hash_table_new(g_str_hash, g_str_equal); 62 ui_info = g_hash_table_new(g_str_hash, g_str_equal);
69 63
70 g_hash_table_insert(ui_info, "name", (char*)_("Finch")); 64 g_hash_table_insert(ui_info, "name", (char*)_("Finch"));
71 g_hash_table_insert(ui_info, "version", VERSION); 65 g_hash_table_insert(ui_info, "version", VERSION);
72 } 66 }
73 67
74 return ui_info; 68 return ui_info;
69 }
70
71 static void
72 finch_quit(void)
73 {
74 gnt_ui_uninit();
75 if (ui_info)
76 g_hash_table_destroy(ui_info);
75 } 77 }
76 78
77 static PurpleCoreUiOps core_ops = 79 static PurpleCoreUiOps core_ops =
78 { 80 {
79 finch_prefs_init, 81 finch_prefs_init,
80 debug_init, 82 debug_init,
81 gnt_ui_init, 83 gnt_ui_init,
82 gnt_ui_uninit, 84 finch_quit,
83 finch_ui_get_info, 85 finch_ui_get_info,
84 86
85 /* padding */ 87 /* padding */
86 NULL, 88 NULL,
87 NULL, 89 NULL,
394 } 396 }
395 397
396 return 1; 398 return 1;
397 } 399 }
398 400
399 int main(int argc, char **argv) 401 static gboolean gnt_start(int *argc, char ***argv)
400 { 402 {
401 signal(SIGPIPE, SIG_IGN);
402
403 g_set_prgname("Finch");
404 g_set_application_name(_("Finch"));
405
406 /* Initialize the libpurple stuff */ 403 /* Initialize the libpurple stuff */
407 if (!init_libpurple(argc, argv)) 404 if (!init_libpurple(*argc, *argv))
408 return 0; 405 return FALSE;
409 406
410 purple_blist_show(); 407 purple_blist_show();
408 return TRUE;
409 }
410
411 int main(int argc, char *argv[])
412 {
413 signal(SIGPIPE, SIG_IGN);
414
415 g_set_prgname("Finch");
416 #if GLIB_CHECK_VERSION(2,2,0)
417 g_set_application_name(_("Finch"));
418 #endif
419
420 gnt_init();
421
422 gnt_start(&argc, &argv);
423
411 gnt_main(); 424 gnt_main();
412 425
413 #ifdef STANDALONE 426 #ifdef STANDALONE
414 purple_core_quit(); 427 purple_core_quit();
415 #endif 428 #endif