gobjectification: b0ea2094: Fixed a few delegators and default blist...

aluink at soc.pidgin.im aluink at soc.pidgin.im
Wed Jul 15 23:05:35 EDT 2009


-----------------------------------------------------------------
Revision: b0ea2094db080f0a23f16835b440058284b5bfcf
Ancestor: 22d658ced930d6608ec29268fd129b62d55ce8a0
Author: aluink at soc.pidgin.im
Date: 2009-07-16T01:13:04
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/b0ea2094db080f0a23f16835b440058284b5bfcf

Modified files:
        libpurple/blist-node.c

ChangeLog: 

Fixed a few delegators and default blist-node methods

-------------- next part --------------
============================================================
--- libpurple/blist-node.c	a88d16ca1af3bea86fe0721322f99d24f7129dad
+++ libpurple/blist-node.c	f114f0ebb7bbe47a97b4588e5e72cdf931362961
@@ -435,10 +435,21 @@ purple_blist_node_contains(PurpleBlistNo
 {
 	return node->parent == parent;
 }
-
 void
 purple_blist_node_add_child(PurpleBlistNode *parent, PurpleBlistNode *child)
 {
+	PurpleBlistNodeClass *klass;
+
+	g_return_if_fail(PURPLE_IS_BLIST_NODE(parent));
+	g_return_if_fail(PURPLE_IS_BLIST_NODE(child));
+
+	klass = PURPLE_GET_BLIST_NODE_CLASS(parent);
+	if(klass && klass->add_child)
+		klass->add_sibling(parent, child);
+}
+static void
+purple_blist_node_real_add_child(PurpleBlistNode *parent, PurpleBlistNode *child)
+{
 	if (parent->child)
 		parent->child->prev = child;
 	child->prev = NULL;
@@ -447,8 +458,8 @@ purple_blist_node_add_child(PurpleBlistN
 	child->parent = parent;
 }
 
-void
-purple_blist_node_add_sibling(PurpleBlistNode *child, PurpleBlistNode *location)
+static void
+purple_blist_node_real_add_sibling(PurpleBlistNode *child, PurpleBlistNode *location)
 {
 	g_return_if_fail(child);
 	g_return_if_fail(location);
@@ -460,8 +471,22 @@ purple_blist_node_add_sibling(PurpleBlis
 	location->next = child;
 }
 
+void
+purple_blist_node_add_sibling(PurpleBlistNode *child, PurpleBlistNode *location)
+{
+	PurpleBlistNodeClass *klass;
+
+	g_return_if_fail(PURPLE_IS_BLIST_NODE(child));
+	g_return_if_fail(PURPLE_IS_BLIST_NODE(location));
+	g_return_if_fail(PURPLE_IS_BLIST_NODE(location->parent));
+
+	klass = PURPLE_GET_BLIST_NODE_CLASS(location->parent);
+	if(klass && klass->add_sibling)
+		klass->add_sibling(child, location);
+}
+
 static void
-purple_blist_node_cls_remove(PurpleBlistNode *child)
+purple_blist_node_real_remove(PurpleBlistNode *child)
 {
 	/* Remove the node from its parent */
 	if (child->prev)
@@ -551,9 +576,9 @@ purple_blist_node_class_init(PurpleBlist
 
 	g_type_class_add_private(klass, sizeof(PurpleBlistNodePrivate));
 
-	klass->add_child = purple_blist_node_add_child;
-	klass->add_sibling = purple_blist_node_add_sibling;
-	klass->remove = purple_blist_node_cls_remove;
+	klass->add_child = purple_blist_node_real_add_child;
+	klass->add_sibling = purple_blist_node_real_add_sibling;
+	klass->remove = purple_blist_node_real_remove;
 
 	purple_signal_register( purple_blist_node_handle(),
 													"group-removed",


More information about the Commits mailing list