summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Laager <rlaager@pidgin.im>2008-11-16 10:33:36 +0000
committerRichard Laager <rlaager@pidgin.im>2008-11-16 10:33:36 +0000
commita68fe7f6d9dad0f52c69bcce97d28db4b9013be9 (patch)
tree0e1eac3b3f063d0566d9b5a21579b613899930ed
parent65f1d41ae0bb9d5fd81cc9ad325280b8b5691eea (diff)
downloadpidgin-a68fe7f6d9dad0f52c69bcce97d28db4b9013be9.tar.gz
Deprecate purple_request_field_list_add()
-rw-r--r--finch/gntplugin.c2
-rw-r--r--finch/gntprefs.c2
-rw-r--r--finch/plugins/gnthistory.c2
-rw-r--r--libpurple/plugins/perl/common/Request.xs7
-rw-r--r--libpurple/protocols/gg/gg.c15
-rw-r--r--libpurple/protocols/gg/gg.h1
-rw-r--r--libpurple/protocols/jabber/xdata.c2
-rw-r--r--libpurple/protocols/sametime/sametime.c8
-rw-r--r--libpurple/protocols/silc/buddy.c2
-rw-r--r--libpurple/protocols/silc/chat.c2
-rw-r--r--libpurple/protocols/silc10/buddy.c2
-rw-r--r--libpurple/protocols/silc10/chat.c2
-rw-r--r--libpurple/request.c2
-rw-r--r--libpurple/request.h6
14 files changed, 31 insertions, 24 deletions
diff --git a/finch/gntplugin.c b/finch/gntplugin.c
index 4c1127cbc2..565373d240 100644
--- a/finch/gntplugin.c
+++ b/finch/gntplugin.c
@@ -496,7 +496,7 @@ process_pref_frame(PurplePluginPrefFrame *frame)
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;
diff --git a/finch/gntprefs.c b/finch/gntprefs.c
index 3b20960a7c..4118c388a1 100644
--- a/finch/gntprefs.c
+++ b/finch/gntprefs.c
@@ -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);
}
diff --git a/finch/plugins/gnthistory.c b/finch/plugins/gnthistory.c
index 60128d491e..73d4aec1f6 100644
--- a/finch/plugins/gnthistory.c
+++ b/finch/plugins/gnthistory.c
@@ -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);
diff --git a/libpurple/plugins/perl/common/Request.xs b/libpurple/plugins/perl/common/Request.xs
index 03ef5bfae6..16e558f76f 100644
--- a/libpurple/plugins/perl/common/Request.xs
+++ b/libpurple/plugins/perl/common/Request.xs
@@ -374,6 +374,13 @@ purple_request_field_list_add(field, item, data)
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
diff --git a/libpurple/protocols/gg/gg.c b/libpurple/protocols/gg/gg.c
index e334838caf..5522ce04b8 100644
--- a/libpurple/protocols/gg/gg.c
+++ b/libpurple/protocols/gg/gg.c
@@ -831,16 +831,16 @@ static void ggp_change_passwd(PurplePluginAction *action)
/* 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(PurpleBlistNode *node, gpointer ignored)
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(PurpleBlistNode *node, gpointer ignored)
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);
diff --git a/libpurple/protocols/gg/gg.h b/libpurple/protocols/gg/gg.h
index de40b240f6..73994c0417 100644
--- a/libpurple/protocols/gg/gg.h
+++ b/libpurple/protocols/gg/gg.h
@@ -62,7 +62,6 @@ typedef struct {
GList *chats;
GGPSearches *searches;
- uin_t tmp_buddy;
int chats_count;
} GGPInfo;
diff --git a/libpurple/protocols/jabber/xdata.c b/libpurple/protocols/jabber/xdata.c
index 9eff9a84f9..0d45129243 100644
--- a/libpurple/protocols/jabber/xdata.c
+++ b/libpurple/protocols/jabber/xdata.c
@@ -302,7 +302,7 @@ void *jabber_x_data_request_with_actions(JabberStream *js, xmlnode *packet, GLis
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);
}
diff --git a/libpurple/protocols/sametime/sametime.c b/libpurple/protocols/sametime/sametime.c
index 061b64053a..ee2cad8606 100644
--- a/libpurple/protocols/sametime/sametime.c
+++ b/libpurple/protocols/sametime/sametime.c
@@ -3505,10 +3505,10 @@ static void blist_menu_conf_list(PurpleBuddy *buddy,
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 mwResolveResult *result,
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);
diff --git a/libpurple/protocols/silc/buddy.c b/libpurple/protocols/silc/buddy.c
index 112d796ddd..789b2b7501 100644
--- a/libpurple/protocols/silc/buddy.c
+++ b/libpurple/protocols/silc/buddy.c
@@ -1178,7 +1178,7 @@ silcpurple_add_buddy_select(SilcPurpleBuddyRes r, SilcDList clients)
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);
}
diff --git a/libpurple/protocols/silc/chat.c b/libpurple/protocols/silc/chat.c
index 320cfbd31a..f4a5ad4dab 100644
--- a/libpurple/protocols/silc/chat.c
+++ b/libpurple/protocols/silc/chat.c
@@ -472,7 +472,7 @@ void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel,
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);
diff --git a/libpurple/protocols/silc10/buddy.c b/libpurple/protocols/silc10/buddy.c
index 67e53f630f..c8e4823fec 100644
--- a/libpurple/protocols/silc10/buddy.c
+++ b/libpurple/protocols/silc10/buddy.c
@@ -1176,7 +1176,7 @@ silcpurple_add_buddy_select(SilcPurpleBuddyRes r,
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);
}
diff --git a/libpurple/protocols/silc10/chat.c b/libpurple/protocols/silc10/chat.c
index 0331fffeb4..b9c903ef51 100644
--- a/libpurple/protocols/silc10/chat.c
+++ b/libpurple/protocols/silc10/chat.c
@@ -449,7 +449,7 @@ void silcpurple_chat_chauth_show(SilcPurple sg, SilcChannelEntry channel,
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);
diff --git a/libpurple/request.c b/libpurple/request.c
index 7f478b28b7..c63fe179ab 100644
--- a/libpurple/request.c
+++ b/libpurple/request.c
@@ -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"
diff --git a/libpurple/request.h b/libpurple/request.h
index 2e3b357c3a..3063485002 100644
--- a/libpurple/request.h
+++ b/libpurple/request.h
@@ -908,6 +908,7 @@ gboolean purple_request_field_list_get_multi_select(
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_get_data(const PurpleRequestField *field,
*/
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,