/soc/2013/ankitkv/gobjectification: 15fb9e64d477: Replaced Purpl...
Ankit Vani
a at nevitus.org
Mon Aug 5 12:23:21 EDT 2013
Changeset: 15fb9e64d4771f85bfcba7f56a414aea3fbc06ab
Author: Ankit Vani <a at nevitus.org>
Date: 2013-08-05 21:17 +0530
Branch: soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/15fb9e64d477
Description:
Replaced PurplePluginProtocolInfo* with PurpleConnection* in PurpleProtocolAction
diffstat:
finch/gntblist.c | 6 ++++--
libpurple/prpl.h | 12 ++++++------
pidgin/gtkblist.c | 1 +
3 files changed, 11 insertions(+), 8 deletions(-)
diffs (77 lines):
diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -2480,7 +2480,8 @@ protocol_action(GntMenuItem *item, gpoin
}
static void
-build_protocol_actions(GntMenuItem *item, PurplePluginProtocolInfo *prpl_info)
+build_protocol_actions(GntMenuItem *item, PurplePluginProtocolInfo *prpl_info,
+ PurpleConnection *gc)
{
GntWidget *sub = gnt_menu_new(GNT_MENU_POPUP);
GList *l;
@@ -2490,6 +2491,7 @@ build_protocol_actions(GntMenuItem *item
for (l = prpl_info->actions; l; l = l->next) {
if (l->data) {
PurpleProtocolAction *action = l->data;
+ action->connection = gc;
menuitem = gnt_menuitem_new(action->label);
gnt_menu_add_item(GNT_MENU(sub), menuitem);
@@ -2606,7 +2608,7 @@ reconstruct_accounts_menu(void)
if (prpl_info->actions != NULL) {
item = gnt_menuitem_new(purple_account_get_username(account));
gnt_menu_add_item(GNT_MENU(sub), item);
- build_protocol_actions(item, prpl_info);
+ build_protocol_actions(item, prpl_info, gc);
}
}
}
diff --git a/libpurple/prpl.h b/libpurple/prpl.h
--- a/libpurple/prpl.h
+++ b/libpurple/prpl.h
@@ -220,7 +220,7 @@ typedef enum
struct _PurpleProtocolAction {
char *label;
PurpleProtocolActionCallback callback;
- PurplePluginProtocolInfo *prpl_info;
+ PurpleConnection *connection;
};
/**
@@ -236,11 +236,6 @@ struct _PurplePluginProtocolInfo
const char *name;
/**
- * Actions that the protocol can perform
- */
- GList *actions;
-
- /**
* The size of the PurplePluginProtocolInfo. This should always be sizeof(PurplePluginProtocolInfo).
* This allows adding more functions to this struct without requiring a major version bump.
*/
@@ -266,6 +261,11 @@ struct _PurplePluginProtocolInfo
GList *user_splits; /**< A GList of PurpleAccountUserSplit */
GList *protocol_options; /**< A GList of PurpleAccountOption */
+ /**
+ * Actions that the protocol can perform
+ */
+ GList *actions;
+
PurpleBuddyIconSpec icon_spec; /**< The icon spec. */
/**
diff --git a/pidgin/gtkblist.c b/pidgin/gtkblist.c
--- a/pidgin/gtkblist.c
+++ b/pidgin/gtkblist.c
@@ -8313,6 +8313,7 @@ pidgin_blist_update_accounts_menu(void)
if (l->data)
{
action = (PurpleProtocolAction *) l->data;
+ action->connection = gc;
menuitem = gtk_menu_item_new_with_label(action->label);
gtk_menu_shell_append(GTK_MENU_SHELL(submenu), menuitem);
More information about the Commits
mailing list