# HG changeset patch # User Gabriel Schulhof # Date 1194704544 0 # Node ID fbb044f7af3d0b98f23712efe55f5167ddf41a2d # Parent b2e646507c1818e99d7835353e7d93c8c2acedc8 Make small array of _show_with_parent functions and use indices into that array as params in the GtkItemFactoryEntry list, rather than the function pointers themselves diff -r b2e646507c18 -r fbb044f7af3d pidgin/gtkblist.c --- a/pidgin/gtkblist.c Sat Nov 10 05:20:46 2007 +0000 +++ b/pidgin/gtkblist.c Sat Nov 10 14:22:24 2007 +0000 @@ -116,6 +116,7 @@ static GList *pidgin_blist_sort_methods = NULL; static struct pidgin_blist_sort_method *current_sort_method = NULL; + static void sort_method_none(PurpleBlistNode *node, PurpleBuddyList *blist, GtkTreeIter groupiter, GtkTreeIter *cur, GtkTreeIter *iter); /* The functions we use for sorting aren't available in gtk 2.0.x, and @@ -3063,15 +3064,18 @@ !purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/debug/enabled")); } -static void -pidgin_blist_show_with_parent(gpointer data1, void (*callback)(GtkWindow *parent), gpointer data3) -{ - callback(GTK_WINDOW(gtkblist->window)); -} - /*************************************************** * Crap * ***************************************************/ +static void (*show_with_parent_funcs)(GtkWindow *parent)[5] = +{ + NULL, + pidgin_pounces_manager_show_with_parent, + pidgin_plugin_dialog_show_with_parent, + pidgin_syslog_show_with_parent, + pidgin_dialogs_about_with_parent +}; + static GtkItemFactoryEntry blist_menu[] = { /* Buddies menu */ @@ -3101,15 +3105,15 @@ /* Tools */ { N_("/_Tools"), NULL, NULL, 0, "", NULL }, - { N_("/Tools/Buddy _Pounces"), NULL, pidgin_blist_show_with_parent, (int)pidgin_pounces_manager_show_with_parent, "", NULL }, + { N_("/Tools/Buddy _Pounces"), NULL, pidgin_blist_show_with_parent, 1, "", NULL }, { N_("/Tools/_Certificates"), NULL, pidgin_certmgr_show, 0, "", NULL }, - { N_("/Tools/Plu_gins"), "U", pidgin_blist_show_with_parent, (int)pidgin_plugin_dialog_show_with_parent, "", PIDGIN_STOCK_TOOLBAR_PLUGINS }, + { N_("/Tools/Plu_gins"), "U", pidgin_blist_show_with_parent, 2, "", PIDGIN_STOCK_TOOLBAR_PLUGINS }, { N_("/Tools/Pr_eferences"), "P", pidgin_prefs_show, 0, "", GTK_STOCK_PREFERENCES }, { N_("/Tools/Pr_ivacy"), NULL, pidgin_privacy_dialog_show, 0, "", NULL }, { "/Tools/sep2", NULL, NULL, 0, "", NULL }, { N_("/Tools/_File Transfers"), "T", pidgin_xfer_dialog_show, 0, "", NULL }, { N_("/Tools/R_oom List"), NULL, pidgin_roomlist_dialog_show, 0, "", NULL }, - { N_("/Tools/System _Log"), NULL, pidgin_blist_show_with_parent, (int)pidgin_syslog_show_with_parent, "", NULL }, + { N_("/Tools/System _Log"), NULL, pidgin_blist_show_with_parent, 3, "", NULL }, { "/Tools/sep3", NULL, NULL, 0, "", NULL }, { N_("/Tools/Mute _Sounds"), "S", pidgin_blist_mute_sounds_cb, 0, "", NULL }, /* Help */ @@ -3117,12 +3121,18 @@ { N_("/Help/Online _Help"), "F1", gtk_blist_show_onlinehelp_cb, 0, "", GTK_STOCK_HELP }, { N_("/Help/_Debug Window"), NULL, toggle_debug, 0, "", NULL }, #if GTK_CHECK_VERSION(2,6,0) - { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, (int)pidgin_dialogs_about_with_parent, "", GTK_STOCK_ABOUT }, + { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, 4, "", GTK_STOCK_ABOUT }, #else - { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, (int)pidgin_dialogs_about_with_parent, "", NULL }, + { N_("/Help/_About"), NULL, pidgin_blist_show_with_parent, 4, "", NULL }, #endif }; +static void +pidgin_blist_show_with_parent(gpointer data1, gint show_with_parent_idx, gpointer data3) +{ + show_with_parent_funcs[show_with_parent_idx](GTK_WINDOW(gtkblist->window)); +} + /********************************************************* * Private Utility functions * *********************************************************/