gobjectification: d24df462: Quick fix for group remove

aluink at soc.pidgin.im aluink at soc.pidgin.im
Wed Jul 15 20:55:33 EDT 2009


-----------------------------------------------------------------
Revision: d24df4629a2e97deead4b96026c115b693d0e4ac
Ancestor: b64730787353d3c8678ee066953f1ab16e58cc35
Author: aluink at soc.pidgin.im
Date: 2009-07-13T14:30:14
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/d24df4629a2e97deead4b96026c115b693d0e4ac

Modified files:
        libpurple/blist-node.c libpurple/blist-node.h
        libpurple/blist.c

ChangeLog: 

Quick fix for group remove

-------------- next part --------------
============================================================
--- libpurple/blist-node.c	da7c3d2a7189adb0e489558fff95cd99ee5c86ed
+++ libpurple/blist-node.c	8ae1698388babe08a9b9278e9a2bd146980f3444
@@ -493,6 +493,12 @@ purple_blist_node_strip(PurpleBlistNode 
 	node->parent = node->child = node->next = node->prev = NULL;
 }
 
+gboolean
+purple_blist_node_is_empty(PurpleBlistNode *node)
+{
+	return node->child;
+}
+
 /******************/
 /*  GObject Code  */
 /******************/
============================================================
--- libpurple/blist-node.h	c68193160082d8caf7c874498fb0b599a61a577d
+++ libpurple/blist-node.h	3dc8b5ca3676ad0f0001783f85d7423b28a0b3be
@@ -265,6 +265,13 @@ GHashTable *purple_blist_node_get_settin
 GHashTable *purple_blist_node_get_settings(PurpleBlistNode *node);
 
 /**
+ * Returns whether a node has any children or not
+ *
+ * @return the empty state
+ */
+gboolean purple_blist_node_is_empty(PurpleBlistNode *node);
+
+/**
  * Retrieves a named integer setting from a node in the buddy list
  *
  * @param node  The node to retrieve the data from
============================================================
--- libpurple/blist.c	d0d36f1e2aa8bde6b01ee6f7aac8a908914bf4f1
+++ libpurple/blist.c	485859afe51764381515ff705ba07f6ae0158558
@@ -910,7 +910,7 @@ void purple_blist_remove_group(PurpleGro
 	node = (PurpleBlistNode *)group;
 
 	/* Make sure the group is empty */
-	if (node->child)
+	if (purple_blist_node_is_empty(node))
 		return;
 
 	/* Remove the node from its parent */


More information about the Commits mailing list