/soc/2013/ankitkv/gobjectification: 6e0d13978666: Global replace...

Ankit Vani a at nevitus.org
Wed Jul 3 12:19:43 EDT 2013


Changeset: 6e0d13978666b7c64c6f8ee43f608198ef4de703
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-03 21:49 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/6e0d13978666

Description:

Global replace to use GObject-style macros. See details.
* Changed 'PURPLE_BLIST_NODE_IS_' to 'PURPLE_IS_'
* Changed 'PURPLE_BUDDY_IS_ONLINE' to 'PURPLE_IS_BUDDY_ONLINE'

diffstat:

 finch/gntblist.c                           |  168 ++++++++--------
 finch/gntlog.c                             |    4 +-
 finch/gntpounce.c                          |    4 +-
 finch/gntrequest.c                         |    4 +-
 finch/plugins/grouping.c                   |   12 +-
 libpurple/accounts.c                       |    8 +-
 libpurple/blist.c                          |   90 ++++----
 libpurple/buddyicon.c                      |   26 +-
 libpurple/dbus-define-api.h                |   10 +-
 libpurple/log.c                            |    4 +-
 libpurple/protocols/bonjour/bonjour.c      |    4 +-
 libpurple/protocols/gg/gg.c                |    6 +-
 libpurple/protocols/gg/purplew.c           |    6 +-
 libpurple/protocols/jabber/adhoccommands.c |    2 +-
 libpurple/protocols/jabber/buddy.c         |   16 +-
 libpurple/protocols/jabber/google/google.c |    2 +-
 libpurple/protocols/jabber/jabber.c        |   10 +-
 libpurple/protocols/msn/msn.c              |    6 +-
 libpurple/protocols/msn/user.c             |    2 +-
 libpurple/protocols/mxit/mxit.c            |    2 +-
 libpurple/protocols/myspace/myspace.c      |    2 +-
 libpurple/protocols/myspace/zap.c          |    6 +-
 libpurple/protocols/novell/novell.c        |   12 +-
 libpurple/protocols/null/nullprpl.c        |    2 +-
 libpurple/protocols/oscar/authorization.c  |    2 +-
 libpurple/protocols/oscar/oscar.c          |   18 +-
 libpurple/protocols/sametime/sametime.c    |   36 +-
 libpurple/protocols/silc/buddy.c           |   10 +-
 libpurple/protocols/silc/chat.c            |   22 +-
 libpurple/protocols/silc/silc.c            |    4 +-
 libpurple/protocols/yahoo/libymsg.c        |   10 +-
 libpurple/protocols/zephyr/zephyr.c        |    2 +-
 pidgin/gtkblist.c                          |  292 ++++++++++++++--------------
 pidgin/gtkconv.c                           |   30 +-
 pidgin/gtkdialogs.c                        |    6 +-
 pidgin/gtklog.c                            |    4 +-
 pidgin/gtkpounce.c                         |    6 +-
 pidgin/gtkutils.c                          |    4 +-
 pidgin/plugins/gevolution/gevo-util.c      |    2 +-
 pidgin/plugins/gevolution/gevolution.c     |    2 +-
 pidgin/plugins/ticker/ticker.c             |    8 +-
 41 files changed, 433 insertions(+), 433 deletions(-)

diffs (truncated from 3221 to 300 lines):

diff --git a/finch/gntblist.c b/finch/gntblist.c
--- a/finch/gntblist.c
+++ b/finch/gntblist.c
@@ -167,12 +167,12 @@ static gboolean default_can_add_node(Pur
 {
 	gboolean offline = purple_prefs_get_bool(PREF_ROOT "/showoffline");
 
-	if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+	if (PURPLE_IS_BUDDY(node)) {
 		PurpleBuddy *buddy = (PurpleBuddy*)node;
 		FinchBlistNode *fnode = purple_blist_node_get_ui_data(node);
 		if (!purple_buddy_get_contact(buddy))
 			return FALSE; /* When a new buddy is added and show-offline is set */
-		if (PURPLE_BUDDY_IS_ONLINE(buddy))
+		if (PURPLE_IS_BUDDY_ONLINE(buddy))
 			return TRUE;  /* The buddy is online */
 		if (!purple_account_is_connected(purple_buddy_get_account(buddy)))
 			return FALSE; /* The account is disconnected. Do not show */
@@ -182,18 +182,18 @@ static gboolean default_can_add_node(Pur
 			return TRUE;  /* Show if the buddy just signed off */
 		if (purple_blist_node_get_bool(node, "show_offline"))
 			return TRUE;
-	} else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+	} else if (PURPLE_IS_CONTACT(node)) {
 		PurpleBlistNode *nd;
 		for (nd = purple_blist_node_get_first_child(node);
 				nd; nd = purple_blist_node_get_sibling_next(nd)) {
 			if (default_can_add_node(nd))
 				return TRUE;
 		}
-	} else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
+	} else if (PURPLE_IS_CHAT(node)) {
 		PurpleChat *chat = (PurpleChat*)node;
 		if (purple_account_is_connected(purple_chat_get_account(chat)))
 			return TRUE;  /* Show whenever the account is online */
-	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+	} else if (PURPLE_IS_GROUP(node)) {
 		PurpleBlistNode *nd;
 		gboolean empty = purple_prefs_get_bool(PREF_ROOT "/emptygroups");
 		if (empty)
@@ -242,9 +242,9 @@ static gboolean default_create_tooltip(g
 
 	str = g_string_new("");
 
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+	if (PURPLE_IS_CONTACT(node)) {
 		PurpleBuddy *pr = purple_contact_get_priority_buddy((PurpleContact*)node);
-		gboolean offline = !PURPLE_BUDDY_IS_ONLINE(pr);
+		gboolean offline = !PURPLE_IS_BUDDY_ONLINE(pr);
 		gboolean showoffline = purple_prefs_get_bool(PREF_ROOT "/showoffline");
 		const char *name = purple_buddy_get_name(pr);
 
@@ -261,18 +261,18 @@ static gboolean default_create_tooltip(g
 				continue;
 			if (!purple_account_is_connected(purple_buddy_get_account(buddy)))
 				continue;
-			if (!showoffline && !PURPLE_BUDDY_IS_ONLINE(buddy))
+			if (!showoffline && !PURPLE_IS_BUDDY_ONLINE(buddy))
 				continue;
 			str = g_string_append(str, "\n----------\n");
 			tooltip_for_buddy(buddy, str, FALSE);
 		}
-	} else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+	} else if (PURPLE_IS_BUDDY(node)) {
 		PurpleBuddy *buddy = (PurpleBuddy *)node;
 		tooltip_for_buddy(buddy, str, TRUE);
 		title = g_strdup(purple_buddy_get_name(buddy));
-		if (!PURPLE_BUDDY_IS_ONLINE((PurpleBuddy*)node))
+		if (!PURPLE_IS_BUDDY_ONLINE((PurpleBuddy*)node))
 			lastseen = purple_blist_node_get_int(node, "last_seen");
-	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+	} else if (PURPLE_IS_GROUP(node)) {
 		PurpleGroup *group = (PurpleGroup *)node;
 
 		g_string_append_printf(str, _("Online: %d\nTotal: %d"),
@@ -280,7 +280,7 @@ static gboolean default_create_tooltip(g
 						purple_blist_get_group_size(group, FALSE));
 
 		title = g_strdup(purple_group_get_name(group));
-	} else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
+	} else if (PURPLE_IS_CHAT(node)) {
 		PurpleChat *chat = (PurpleChat *)node;
 		PurpleAccount *account = purple_chat_get_account(chat);
 
@@ -357,9 +357,9 @@ get_display_color(PurpleBlistNode  *node
 	PurpleBuddy *buddy;
 	int color = 0;
 
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+	if (PURPLE_IS_CONTACT(node))
 		node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node)));
-	if (!PURPLE_BLIST_NODE_IS_BUDDY(node))
+	if (!PURPLE_IS_BUDDY(node))
 		return 0;
 
 	buddy = (PurpleBuddy*)node;
@@ -388,12 +388,12 @@ get_blist_node_flag(PurpleBlistNode *nod
 
 	if (fnode && fnode->signed_timer)
 		flag |= GNT_TEXT_FLAG_BLINK;
-	else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+	else if (PURPLE_IS_CONTACT(node)) {
 		node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node)));
 		fnode = purple_blist_node_get_ui_data(node);
 		if (fnode && fnode->signed_timer)
 			flag |= GNT_TEXT_FLAG_BLINK;
-	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+	} else if (PURPLE_IS_GROUP(node)) {
 		/* If the node is collapsed, then check to see if any of the priority buddies of
 		 * any of the contacts within this group recently signed on/off, and set the blink
 		 * flag appropriately. */
@@ -434,7 +434,7 @@ is_contact_online(PurpleContact *contact
 	for (node = purple_blist_node_get_first_child(((PurpleBlistNode*)contact)); node;
 			node = purple_blist_node_get_sibling_next(node)) {
 		FinchBlistNode *fnode = purple_blist_node_get_ui_data(node);
-		if (PURPLE_BUDDY_IS_ONLINE((PurpleBuddy*)node) ||
+		if (PURPLE_IS_BUDDY_ONLINE((PurpleBuddy*)node) ||
 				(fnode && fnode->signed_timer))
 			return TRUE;
 	}
@@ -447,7 +447,7 @@ is_group_online(PurpleGroup *group)
 	PurpleBlistNode *node;
 	for (node = purple_blist_node_get_first_child(((PurpleBlistNode*)group)); node;
 			node = purple_blist_node_get_sibling_next(node)) {
-		if (PURPLE_BLIST_NODE_IS_CHAT(node) &&
+		if (PURPLE_IS_CHAT(node) &&
 				purple_account_is_connected(((PurpleChat *)node)->account))
 			return TRUE;
 		else if (is_contact_online((PurpleContact*)node))
@@ -471,13 +471,13 @@ add_node(PurpleBlistNode *node, FinchBli
 	if (!ggblist->manager->can_add_node(node))
 		return;
 
-	if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+	if (PURPLE_IS_BUDDY(node))
 		add_buddy((PurpleBuddy*)node, ggblist);
-	else if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+	else if (PURPLE_IS_CONTACT(node))
 		add_contact((PurpleContact*)node, ggblist);
-	else if (PURPLE_BLIST_NODE_IS_GROUP(node))
+	else if (PURPLE_IS_GROUP(node))
 		add_group((PurpleGroup*)node, ggblist);
-	else if (PURPLE_BLIST_NODE_IS_CHAT(node))
+	else if (PURPLE_IS_CHAT(node))
 		add_chat((PurpleChat *)node, ggblist);
 
 	draw_tooltip(ggblist);
@@ -505,7 +505,7 @@ node_remove(PurpleBuddyList *list, Purpl
 	if (ggblist == NULL || purple_blist_node_get_ui_data(node) == NULL)
 		return;
 
-	if (PURPLE_BLIST_NODE_IS_GROUP(node) && ggblist->new_group) {
+	if (PURPLE_IS_GROUP(node) && ggblist->new_group) {
 		ggblist->new_group = g_list_remove(ggblist->new_group, node);
 	}
 
@@ -553,19 +553,19 @@ node_update(PurpleBuddyList *list, Purpl
 			node_remove(list, node);
 	}
 
-	if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+	if (PURPLE_IS_BUDDY(node)) {
 		PurpleBuddy *buddy = (PurpleBuddy*)node;
 		add_node((PurpleBlistNode*)buddy, FINCH_GET_DATA(list));
 		node_update(list, purple_blist_node_get_parent(node));
-	} else if (PURPLE_BLIST_NODE_IS_CHAT(node)) {
+	} else if (PURPLE_IS_CHAT(node)) {
 		add_node(node, FINCH_GET_DATA(list));
-	} else if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+	} else if (PURPLE_IS_CONTACT(node)) {
 		if (purple_blist_node_get_ui_data(node)== NULL) {
 			/* The core seems to expect the UI to add the buddies. */
 			for (node = purple_blist_node_get_first_child(node); node; node = purple_blist_node_get_sibling_next(node))
 				add_node(node, FINCH_GET_DATA(list));
 		}
-	} else if (PURPLE_BLIST_NODE_IS_GROUP(node)) {
+	} else if (PURPLE_IS_GROUP(node)) {
 		if (!ggblist->manager->can_add_node(node))
 			node_remove(list, node);
 		else
@@ -903,13 +903,13 @@ get_display_name(PurpleBlistNode *node)
 	char status[8] = " ";
 	const char *name = NULL;
 
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+	if (PURPLE_IS_CONTACT(node))
 		node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node)));  /* XXX: this can return NULL?! */
 
 	if (node == NULL)
 		return NULL;
 
-	if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+	if (PURPLE_IS_BUDDY(node))
 	{
 		PurpleBuddy *buddy = (PurpleBuddy *)node;
 		PurpleStatusPrimitive prim;
@@ -939,14 +939,14 @@ get_display_name(PurpleBlistNode *node)
 		}
 		name = purple_buddy_get_alias(buddy);
 	}
-	else if (PURPLE_BLIST_NODE_IS_CHAT(node))
+	else if (PURPLE_IS_CHAT(node))
 	{
 		PurpleChat *chat = (PurpleChat*)node;
 		name = purple_chat_get_name(chat);
 
 		strncpy(status, "~", sizeof(status) - 1);
 	}
-	else if (PURPLE_BLIST_NODE_IS_GROUP(node))
+	else if (PURPLE_IS_GROUP(node))
 		return purple_group_get_name((PurpleGroup*)node);
 
 	g_snprintf(text, sizeof(text) - 1, "%s %s", status, name);
@@ -1044,10 +1044,10 @@ selection_activate(GntWidget *widget, Fi
 	if (!node)
 		return;
 
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+	if (PURPLE_IS_CONTACT(node))
 		node = PURPLE_BLIST_NODE(purple_contact_get_priority_buddy(PURPLE_CONTACT(node)));
 
-	if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+	if (PURPLE_IS_BUDDY(node))
 	{
 		PurpleBuddy *buddy = (PurpleBuddy *)node;
 		PurpleIMConversation *im;
@@ -1062,7 +1062,7 @@ selection_activate(GntWidget *widget, Fi
 		}
 		finch_conversation_set_active(PURPLE_CONVERSATION(im));
 	}
-	else if (PURPLE_BLIST_NODE_IS_CHAT(node))
+	else if (PURPLE_IS_CHAT(node))
 	{
 		join_chat((PurpleChat*)node);
 	}
@@ -1249,7 +1249,7 @@ static void
 finch_blist_pounce_node_cb(PurpleBlistNode *selected, PurpleBlistNode *node)
 {
 	PurpleBuddy *b;
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+	if (PURPLE_IS_CONTACT(node))
 		b = purple_contact_get_priority_buddy((PurpleContact *)node);
 	else
 		b = (PurpleBuddy *)node;
@@ -1361,18 +1361,18 @@ rename_blist_node(PurpleBlistNode *node,
 	if (name && !*name)
 		name = NULL;
 
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node)) {
+	if (PURPLE_IS_CONTACT(node)) {
 		PurpleContact *contact = (PurpleContact*)node;
 		PurpleBuddy *buddy = purple_contact_get_priority_buddy(contact);
 		purple_blist_alias_contact(contact, name);
 		purple_blist_alias_buddy(buddy, name);
 		serv_alias_buddy(buddy);
-	} else if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+	} else if (PURPLE_IS_BUDDY(node)) {
 		purple_blist_alias_buddy((PurpleBuddy*)node, name);
 		serv_alias_buddy((PurpleBuddy*)node);
-	} else if (PURPLE_BLIST_NODE_IS_CHAT(node))
+	} else if (PURPLE_IS_CHAT(node))
 		purple_blist_alias_chat((PurpleChat*)node, name);
-	else if (PURPLE_BLIST_NODE_IS_GROUP(node) && (name != NULL))
+	else if (PURPLE_IS_GROUP(node) && (name != NULL))
 		purple_blist_rename_group((PurpleGroup*)node, name);
 	else
 		g_return_if_reached();
@@ -1385,20 +1385,20 @@ finch_blist_rename_node_cb(PurpleBlistNo
 	char *prompt;
 	const char *text;
 
-	if (PURPLE_BLIST_NODE_IS_CONTACT(node))
+	if (PURPLE_IS_CONTACT(node))
 		name = purple_contact_get_alias((PurpleContact*)node);
-	else if (PURPLE_BLIST_NODE_IS_BUDDY(node))
+	else if (PURPLE_IS_BUDDY(node))
 		name = purple_buddy_get_contact_alias((PurpleBuddy*)node);
-	else if (PURPLE_BLIST_NODE_IS_CHAT(node))
+	else if (PURPLE_IS_CHAT(node))
 		name = purple_chat_get_name((PurpleChat*)node);
-	else if (PURPLE_BLIST_NODE_IS_GROUP(node))
+	else if (PURPLE_IS_GROUP(node))
 		name = purple_group_get_name((PurpleGroup*)node);
 	else
 		g_return_if_reached();
 
 	prompt = g_strdup_printf(_("Please enter the new name for %s"), name);
 
-	text = PURPLE_BLIST_NODE_IS_GROUP(node) ? _("Rename") : _("Set Alias");
+	text = PURPLE_IS_GROUP(node) ? _("Rename") : _("Set Alias");
 	purple_request_input(node, text, prompt, _("Enter empty string to reset the name."),
 			name, FALSE, FALSE, NULL, text, G_CALLBACK(rename_blist_node),
 			_("Cancel"), NULL,
@@ -1415,12 +1415,12 @@ static void showlog_cb(PurpleBlistNode *
 	PurpleAccount *account;
 	char *name = NULL;
 
-	if (PURPLE_BLIST_NODE_IS_BUDDY(node)) {
+	if (PURPLE_IS_BUDDY(node)) {
 		PurpleBuddy *b = (PurpleBuddy*) node;



More information about the Commits mailing list