/soc/2013/ankitkv/gobjectification: e4fc06261814: GObjectified P...

Ankit Vani a at nevitus.org
Sat Jul 6 18:41:38 EDT 2013


Changeset: e4fc062618144366ca0fb5a96eb23da5d4ccb0a0
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2013-07-07 04:11 +0530
Branch:	 soc.2013.gobjectification
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/e4fc06261814

Description:

GObjectified PurpleBListNode source

diffstat:

 libpurple/blistnode.c |  27 +++++++++++++++++++++------
 libpurple/buddylist.c |  14 --------------
 2 files changed, 21 insertions(+), 20 deletions(-)

diffs (89 lines):

diff --git a/libpurple/blistnode.c b/libpurple/blistnode.c
--- a/libpurple/blistnode.c
+++ b/libpurple/blistnode.c
@@ -20,7 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  *
  */
-#include "blistnode.h"
+#include "blistnodetypes.h"
+#include "internal.h"
 
 #define PURPLE_BLIST_NODE_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE((obj), PURPLE_TYPE_BLIST_NODE, PurpleBListNodePrivate))
@@ -48,6 +49,20 @@ static GObjectClass *parent_class;
 /* Buddy list node API                                                    */
 /**************************************************************************/
 
+static PurpleBListNode *get_next_node(PurpleBListNode *node, gboolean godeep)
+{
+	if (node == NULL)
+		return NULL;
+
+	if (godeep && node->child)
+		return node->child;
+
+	if (node->next)
+		return node->next;
+
+	return get_next_node(node->parent, FALSE);
+}
+
 PurpleBListNode *purple_blist_node_next(PurpleBListNode *node, gboolean offline)
 {
 	PurpleBListNode *ret = node;
@@ -244,7 +259,7 @@ purple_blist_node_set_string(PurpleBList
 
 	value = g_new0(GValue, 1);
 	g_value_init(value, G_TYPE_STRING);
-	g_value_set_int(value, data);
+	g_value_set_string(value, data);
 
 	g_hash_table_replace(priv->settings, g_strdup(key), value);
 
@@ -294,9 +309,9 @@ purple_blist_node_setting_free(gpointer 
 	g_free(value);
 }
 
-/**************************************************************************/
-/* GObject code
-/**************************************************************************/
+/**************************************************************************
+ * GObject code
+ **************************************************************************/
 
 /* GObject Property names */
 #define PROP_DONT_SAVE_S  "dont-save"
@@ -349,7 +364,7 @@ purple_blist_node_init(GTypeInstance *in
 static void
 purple_blist_node_finalize(GObject *object)
 {
-	PurpleBListNode *priv = PURPLE_BLIST_NODE_GET_PRIVATE(object);
+	PurpleBListNodePrivate *priv = PURPLE_BLIST_NODE_GET_PRIVATE(object);
 
 	g_hash_table_destroy(priv->settings);
 
diff --git a/libpurple/buddylist.c b/libpurple/buddylist.c
--- a/libpurple/buddylist.c
+++ b/libpurple/buddylist.c
@@ -767,20 +767,6 @@ void purple_blist_set_visible(gboolean s
 		ops->set_visible(purplebuddylist, show);
 }
 
-static PurpleBListNode *get_next_node(PurpleBListNode *node, gboolean godeep)
-{
-	if (node == NULL)
-		return NULL;
-
-	if (godeep && node->child)
-		return node->child;
-
-	if (node->next)
-		return node->next;
-
-	return get_next_node(node->parent, FALSE);
-}
-
 void
 purple_blist_update_buddy_status(PurpleBuddy *buddy, PurpleStatus *old_status)
 {



More information about the Commits mailing list