cpw.rekkanoryo.icqxstatus: 0e253bb2: Deprecate purple_request_field_list_add(...

rlaager at pidgin.im rlaager at pidgin.im
Sun Nov 16 14:20:41 EST 2008


-----------------------------------------------------------------
Revision: 0e253bb211edeb87aab380306cbc2cd548da2673
Ancestor: 9b4a51d71523cc54c0697fb13954429569c9449d
Author: rlaager at pidgin.im
Date: 2008-11-16T10:33:36
Branch: im.pidgin.cpw.rekkanoryo.icqxstatus
URL: http://d.pidgin.im/viewmtn/revision/info/0e253bb211edeb87aab380306cbc2cd548da2673

Modified files:
        finch/gntplugin.c finch/gntprefs.c
        finch/plugins/gnthistory.c
        libpurple/plugins/perl/common/Request.xs
        libpurple/protocols/gg/gg.c libpurple/protocols/gg/gg.h
        libpurple/protocols/jabber/xdata.c
        libpurple/protocols/sametime/sametime.c
        libpurple/protocols/silc/buddy.c
        libpurple/protocols/silc/chat.c
        libpurple/protocols/silc10/buddy.c
        libpurple/protocols/silc10/chat.c libpurple/request.c
        libpurple/request.h

ChangeLog: 

Deprecate purple_request_field_list_add()

-------------- next part --------------
============================================================
--- finch/gntplugin.c	de6a2c7d1b48b79e31995896ff37ba983b42c991
+++ finch/gntplugin.c	6994430c14d4b146d1f1a1b562438afbc7580552
@@ -496,7 +496,7 @@ process_pref_frame(PurplePluginPrefFrame
 						break;
 				}
 				stringlist = g_list_prepend(stringlist, value);
-				purple_request_field_list_add(field, label, value);
+				purple_request_field_list_add_icon(field, label, NULL, value);
 				if (strcmp(value, current_value) == 0)
 					purple_request_field_list_add_selected(field, label);
 				list = list->next->next;
============================================================
--- finch/gntprefs.c	f99767052ae453a6a10ecb1ce7a5b2030e6fa25f
+++ finch/gntprefs.c	b89205b002cefa7426b014b22c4793615e80830a
@@ -170,7 +170,7 @@ get_pref_field(Prefs *prefs)
 				default:
 					break;
 			}
-			purple_request_field_list_add(field, data, iter->data);
+			purple_request_field_list_add_icon(field, data, NULL, iter->data);
 			if (select)
 				purple_request_field_list_add_selected(field, data);
 		}
============================================================
--- finch/plugins/gnthistory.c	a604ebc8b52bcb44c408e1b0a9673c859d24c464
+++ finch/plugins/gnthistory.c	4dcbc9fd8a1a23acc30af464c4e69f4c49939ca6
@@ -154,7 +154,7 @@ history_prefs_check(PurplePlugin *plugin
 		while (list) {
 			const char *label = _(list->data);
 			list = g_list_delete_link(list, list);
-			purple_request_field_list_add(field, label, list->data);
+			purple_request_field_list_add_icon(field, label, NULL, list->data);
 			if (system && strcmp(system, list->data) == 0)
 				purple_request_field_list_add_selected(field, label);
 			list = g_list_delete_link(list, list);
============================================================
--- libpurple/plugins/perl/common/Request.xs	ac83c233eb655c873588801bfaa771f0a464e325
+++ libpurple/plugins/perl/common/Request.xs	d2611f1e46e5930568b4fe40ea028ce7c9ae7a27
@@ -374,6 +374,13 @@ void
 	void * data
 
 void
+purple_request_field_list_add_icon(field, item, icon_path, data)
+	Purple::Request::Field field
+	const char *item
+	const char *icon_path
+	void * data
+
+void
 purple_request_field_list_add_selected(field, item)
 	Purple::Request::Field field
 	const char *item
============================================================
--- libpurple/protocols/gg/gg.c	8251a4c3cbd7c7f4b7e8648e05714b9a3662b0f0
+++ libpurple/protocols/gg/gg.c	2c37e7f5e2795ff9e020da566ac88d038ab8b3e6
@@ -831,16 +831,16 @@ static void ggp_callback_add_to_chat_ok(
 /* static void ggp_callback_add_to_chat_ok(PurpleConnection *gc, PurpleRequestFields *fields) {{{ */
 static void ggp_callback_add_to_chat_ok(PurpleConnection *gc, PurpleRequestFields *fields)
 {
-	GGPInfo *info = gc->proto_data;
 	PurpleRequestField *field;
-	/* TODO: sel may be null. */
 	GList *sel;
 
 	field = purple_request_fields_get_field(fields, "name");
 	sel = purple_request_field_list_get_selected(field);
+	if (sel == NULL || sel->data == NULL)
+		return;
 
-	ggp_confer_participants_add_uin(gc, sel->data, info->tmp_buddy);
-	info->tmp_buddy = 0;
+	ggp_confer_participants_add_uin(gc, sel->data,
+		GPOINTER_TO_INT(purple_request_field_list_get_data(field, sel->data)));
 }
 /* }}} */
 
@@ -864,9 +864,6 @@ static void ggp_bmenu_add_to_chat(Purple
 	gc = purple_account_get_connection(purple_buddy_get_account(buddy));
 	info = gc->proto_data;
 
-	/* TODO: It tmp_buddy != 0 then stop! */
-	info->tmp_buddy = ggp_str_to_uin(purple_buddy_get_name(buddy));
-
 	fields = purple_request_fields_new();
 	group = purple_request_field_group_new(NULL);
 	purple_request_fields_add_group(fields, group);
@@ -874,8 +871,8 @@ static void ggp_bmenu_add_to_chat(Purple
 	field = purple_request_field_list_new("name", "Chat name");
 	for (l = info->chats; l != NULL; l = l->next) {
 		GGPChat *chat = l->data;
-		purple_request_field_list_add(field, g_strdup(chat->name),
-					    g_strdup(chat->name));
+		purple_request_field_list_add_icon(field, chat->name, NULL,
+			GINT_TO_POINTER(ggp_str_to_uin(purple_buddy_get_name(buddy))));
 	}
 	purple_request_field_group_add_field(group, field);
 
============================================================
--- libpurple/protocols/gg/gg.h	ec3a390b0620337e7b9bada29e9e3a63256decb1
+++ libpurple/protocols/gg/gg.h	14d63672d1f65878160ec0ed5e410cb0bf03fc5c
@@ -62,7 +62,6 @@ typedef struct {
 	GList *chats;
 	GGPSearches *searches;
 
-	uin_t tmp_buddy;
 	int chats_count;
 
 } GGPInfo;
============================================================
--- libpurple/protocols/jabber/xdata.c	d7c206099f052f3cd2b7668bf1291a1fcc5bbb88
+++ libpurple/protocols/jabber/xdata.c	79f8e12f140ce04d0363d3cbe5009d7541010e15
@@ -302,7 +302,7 @@ void *jabber_x_data_request_with_actions
 
 				data->values = g_slist_prepend(data->values, value);
 
-				purple_request_field_list_add(field, lbl, value);
+				purple_request_field_list_add_icon(field, lbl, NULL, value);
 				if(g_list_find_custom(selected, value, (GCompareFunc)strcmp))
 					purple_request_field_list_add_selected(field, lbl);
 			}
============================================================
--- libpurple/protocols/sametime/sametime.c	dab0b7d6c3a41bd313462023f934be90569e512a
+++ libpurple/protocols/sametime/sametime.c	bd75e43ec10d9bdfa5eae206af7fecff15a74603
@@ -3505,10 +3505,10 @@ static void blist_menu_conf_list(PurpleB
   purple_request_field_list_set_multi_select(f, FALSE);
   for(; confs; confs = confs->next) {
     struct mwConference *c = confs->data;
-    purple_request_field_list_add(f, mwConference_getTitle(c), c);
+    purple_request_field_list_add_icon(f, mwConference_getTitle(c), NULL, c);
   }
-  purple_request_field_list_add(f, _("Create New Conference..."),
-			      GINT_TO_POINTER(0x01));
+  purple_request_field_list_add_icon(f, _("Create New Conference..."),
+			      NULL, GINT_TO_POINTER(0x01));
   purple_request_field_group_add_field(g, f);
   
   f = purple_request_field_string_new(CHAT_KEY_INVITE, "Message", NULL, FALSE);
@@ -5434,7 +5434,7 @@ static void remote_group_multi(struct mw
     res->id = g_strdup(match->id);
     res->name = g_strdup(match->name);
 
-    purple_request_field_list_add(f, res->name, res);
+    purple_request_field_list_add_icon(f, res->name, NULL, res);
   }
 
   purple_request_field_group_add_field(g, f);
============================================================
--- libpurple/protocols/silc/buddy.c	7a08c648fb7c5adfe6f6569338d2fec65e1cc5de
+++ libpurple/protocols/silc/buddy.c	4873c5a9c417eb9cd103b015177b6d9d978b3909
@@ -1178,7 +1178,7 @@ silcpurple_add_buddy_select(SilcPurpleBu
 			   client_entry->username, *client_entry->hostname ?
 			   client_entry->hostname : "",
 			   fingerprint ? tmp2 : "");
-		purple_request_field_list_add(f, tmp, client_entry);
+		purple_request_field_list_add_icon(f, tmp, NULL, client_entry);
 		silc_free(fingerprint);
 	}
 
============================================================
--- libpurple/protocols/silc/chat.c	749446bb892a607589f50093346156b207802e04
+++ libpurple/protocols/silc/chat.c	630c4906e5c6dc0432ce4e213b3e433fb4c0da7a
@@ -472,7 +472,7 @@ void silcpurple_chat_chauth_show(SilcPur
 		g_snprintf(tmp2, sizeof(tmp2), "%s\n  %s\n  %s",
 			   ident->realname ? ident->realname : ident->username ?
 			   ident->username : "", fingerprint, babbleprint);
-		purple_request_field_list_add(f, tmp2, public_key);
+		purple_request_field_list_add_icon(f, tmp2, NULL, public_key);
 
 		silc_free(fingerprint);
 		silc_free(babbleprint);
============================================================
--- libpurple/protocols/silc10/buddy.c	5bde4815ce5af331312f85c7a0d1f275ff9e0e11
+++ libpurple/protocols/silc10/buddy.c	dcb51e1ff5ca2fe6b32930b6f01aab59d16e7228
@@ -1176,7 +1176,7 @@ silcpurple_add_buddy_select(SilcPurpleBu
 			   clients[i]->username, clients[i]->hostname ?
 			   clients[i]->hostname : "",
 			   fingerprint ? tmp2 : "");
-		purple_request_field_list_add(f, tmp, clients[i]);
+		purple_request_field_list_add_icon(f, tmp, NULL, clients[i]);
 		silc_free(fingerprint);
 	}
 
============================================================
--- libpurple/protocols/silc10/chat.c	101c56a3b5222fc6f7ef38e652031de38f052cfe
+++ libpurple/protocols/silc10/chat.c	1fb0d4dd8f2bc458afd07e250b999399a938417d
@@ -449,7 +449,7 @@ void silcpurple_chat_chauth_show(SilcPur
 		g_snprintf(tmp2, sizeof(tmp2), "%s\n  %s\n  %s",
 			   ident->realname ? ident->realname : ident->username ?
 			   ident->username : "", fingerprint, babbleprint);
-		purple_request_field_list_add(f, tmp2, pubkey);
+		purple_request_field_list_add_icon(f, tmp2, NULL, pubkey);
 
 		silc_free(fingerprint);
 		silc_free(babbleprint);
============================================================
--- libpurple/request.c	c40ef881a2fd3c66102a312c1b7a5090471279f0
+++ libpurple/request.c	0f7a90048d01b5b11f6bf0554c1af79885bdfa94
@@ -23,6 +23,8 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
+#define _PURPLE_REQUEST_C_
+
 #include "internal.h"
 
 #include "notify.h"
============================================================
--- libpurple/request.h	4f551cffdd23a7f2d038a5d30219ddcb20969e7d
+++ libpurple/request.h	5542ce81d0fdd9e76ea2d5a3467dba65d1e40b26
@@ -908,6 +908,7 @@ void *purple_request_field_list_get_data
 void *purple_request_field_list_get_data(const PurpleRequestField *field,
 									   const char *text);
 
+#if !(defined PURPLE_DISABLE_DEPRECATED) || (defined _PURPLE_REQUEST_C_)
 /**
  * Adds an item to a list field.
  *
@@ -919,13 +920,14 @@ void purple_request_field_list_add(Purpl
  */
 void purple_request_field_list_add(PurpleRequestField *field,
 								 const char *item, void *data);
+#endif
 
 /**
- * Adds an item with icon to a list field.
+ * Adds an item to a list field.
  *
  * @param field The list field.
  * @param item  The list item.
- * @param icon_path The path to icon file.
+ * @param icon_path The path to icon file, or @c NULL for no icon.
  * @param data  The associated data.
  */
 void purple_request_field_list_add_icon(PurpleRequestField *field,


More information about the Commits mailing list