diff src/gtkutils.c @ 7956:1b8261f374ea

[gaim-migrate @ 8631] This is the death of protocol numbers. There are probably now a few functions that should now go away, but i'll let our crack team of crazy patch writers figure out which ones they are. out-of-tree and unofficial prpl-writers, rejoice! committer: Tailor Script <tailor@pidgin.im>
author Nathan Walp <nwalp@pidgin.im>
date Mon, 29 Dec 2003 09:03:47 +0000
parents e8fc79fb648b
children d9e831876c28
line wrap: on
line diff
--- a/src/gtkutils.c	Mon Dec 29 08:59:22 2003 +0000
+++ b/src/gtkutils.c	Mon Dec 29 09:03:47 2003 +0000
@@ -619,22 +619,22 @@
 {
 	GtkWidget *menu;
 	GtkWidget *item;
-	GaimProtocol protocol;
+	const char *protocol;
 	gpointer user_data;
 
 	menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(optmenu));
 	item = gtk_menu_get_active(GTK_MENU(menu));
 
-	protocol = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(item), "protocol"));
+	protocol = g_object_get_data(G_OBJECT(item), "protocol");
 	user_data = (g_object_get_data(G_OBJECT(optmenu), "user_data"));
 
 	if (cb != NULL)
-		((void (*)(GtkWidget *, GaimProtocol, gpointer))cb)(item, protocol,
+		((void (*)(GtkWidget *, const char *, gpointer))cb)(item, protocol,
 															user_data);
 }
 
 GtkWidget *
-gaim_gtk_protocol_option_menu_new(GaimProtocol protocol, GCallback cb,
+gaim_gtk_protocol_option_menu_new(const char *id, GCallback cb,
 								  gpointer user_data)
 {
 	GaimPluginProtocolInfo *prpl_info;
@@ -712,13 +712,12 @@
 		gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
 		gtk_widget_show(label);
 
-		g_object_set_data(G_OBJECT(item), "protocol",
-						 GINT_TO_POINTER(prpl_info->protocol));
+		g_object_set_data(G_OBJECT(item), "protocol", plugin->info->id);
 
 		gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
 		gtk_widget_show(item);
 
-		if (prpl_info->protocol == protocol)
+		if (!strcmp(plugin->info->id, id))
 			selected_index = i;
 	}
 
@@ -799,7 +798,7 @@
 		if (check_account_func && !check_account_func(account))
 			continue;
 
-		plugin = gaim_find_prpl(gaim_account_get_protocol(account));
+		plugin = gaim_find_prpl(gaim_account_get_protocol_id(account));
 
 		if (plugin != NULL)
 			prpl_info = GAIM_PLUGIN_PROTOCOL_INFO(plugin);