gobjectification: 98b9eb30: Fix a few things.

sadrul at pidgin.im sadrul at pidgin.im
Mon Jul 5 18:25:37 EDT 2010


----------------------------------------------------------------------
Revision: 98b9eb30a616844fcdda78b0b4949b0a4774a6bd
Parent:   d3499ff8edddca23b0820f633fac8a989313525a
Author:   sadrul at pidgin.im
Date:     07/05/10 18:23:16
Branch:   im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/98b9eb30a616844fcdda78b0b4949b0a4774a6bd

Changelog: 

Fix a few things.

Most of the fixes are for what looks to be copy/paste errors. I can login
into a yahoo account with this set of changes, although I do get a whole
lot of 'CRITICAL' marked runtime errors.

Changes against parent d3499ff8edddca23b0820f633fac8a989313525a

  patched  libpurple/blist-node.c
  patched  libpurple/blist.c
  patched  libpurple/ghash.c
  patched  libpurple/group.c
  patched  libpurple/protocols/yahoo/libymsg.c

-------------- next part --------------
============================================================
--- libpurple/protocols/yahoo/libymsg.c	fdc989fb0c3ea2aeedcf719df37c4cd81678c470
+++ libpurple/protocols/yahoo/libymsg.c	c866a1f5f1629e6807df3e759f2d39067342851a
@@ -429,7 +429,7 @@ static void yahoo_do_group_check(PurpleA
 			"Uhoh, %s isn't on the list (or not in this group), adding him to group %s.\n", name, group);
 		if (!(g = purple_find_group(group))) {
 			g = purple_group_new(group);
-			purple_blist_node_add_child(PURPLE_BLIST_NODE(g), purple_blist_get_root());
+			purple_blist_node_add_child(purple_blist_get_root(), PURPLE_BLIST_NODE(g));
 		}
 		b = purple_buddy_new(account, name, NULL);
 		purple_blist_add_buddy(b, NULL, g, NULL);
@@ -555,7 +555,7 @@ static void yahoo_process_list_15(Purple
 					if (!(b = purple_find_buddy(account, norm_bud))) {
 						if (!(g = purple_find_group(yd->current_list15_grp))) {
 							g = purple_group_new(yd->current_list15_grp);
-							purple_blist_node_add_child(PURPLE_BLIST_NODE(g), purple_blist_get_root());
+							purple_blist_node_add_child(purple_blist_get_root(), PURPLE_BLIST_NODE(g));
 						}
 						b = purple_buddy_new(account, norm_bud, NULL);
 						purple_blist_add_buddy(b, NULL, g, NULL);
@@ -714,7 +714,7 @@ static void yahoo_process_list(PurpleCon
 				if (!(b = purple_find_buddy(account, norm_bud))) {
 					if (!(g = purple_find_group(grp))) {
 						g = purple_group_new(grp);
-						purple_blist_node_add_child(PURPLE_BLIST_NODE(g), purple_blist_get_root());
+						purple_blist_node_add_child(purple_blist_get_root(), PURPLE_BLIST_NODE(g));
 					}
 					b = purple_buddy_new(account, norm_bud, NULL);
 					purple_blist_add_buddy(b, NULL, g, NULL);
============================================================
--- libpurple/blist.c	3089c7d58e583a7d5a822e1dfbc952adb248e1dd
+++ libpurple/blist.c	60072e69e2dbf5d5fb9fa99d94afb38deffd0ed2
@@ -51,7 +51,7 @@ struct _PurpleBuddyList {
 struct _PurpleBuddyList {
 	PurpleBlistNode node;        /**< The first node in the buddy list */
 	GHashTable *buddies;          /**< Every buddy in this list */
-	
+
 	/**
 	 * A hash table used for efficient lookups of buddies by name.
 	 * PurpleAccount* => GHashTable*, with the inner hash table being
@@ -71,7 +71,7 @@ struct _PurpleBuddyListClass {
 };
 
 struct _PurpleBuddyListClass {
-	PurpleObjectClass parent;
+	PurpleBlistNodeClass parent;
 };
 
 static PurpleBlistUiOps *blist_ui_ops = NULL;
@@ -88,6 +88,8 @@ purple_blist_get_list()
 		GList *account;
 		PurpleBlistUiOps *ui_ops = purple_blist_get_ui_ops();
 		list = g_object_new(PURPLE_BUDDY_LIST_TYPE, NULL);
+
+		purple_blist_load();
 		for (account = purple_accounts_get_all(); account != NULL; account = account->next)	{
 			purple_blist_buddies_cache_add_account(account->data);
 		}
@@ -1592,8 +1594,6 @@ purple_blist_instance_init(GTypeInstance
 
 	gbl->save_timer = 0;
 	gbl->blist_loaded = FALSE;
-
-	purple_blist_load();
 }
 
 static GType
============================================================
--- libpurple/blist-node.c	cffb23533835d1fc912eb27245731beea601a652
+++ libpurple/blist-node.c	8d957029e6fb73aa918c3e8e4def6100963acbcf
@@ -579,6 +579,8 @@ purple_blist_node_remove(PurpleBlistNode
 	PurpleBlistNodeClass *klass;
 
 	g_return_if_fail(PURPLE_IS_BLIST_NODE(child));
+	if (child->parent == NULL)
+		return;
 
 	klass = PURPLE_GET_BLIST_NODE_CLASS(child->parent);
 	if(klass && klass->remove){
============================================================
--- libpurple/group.c	ac5be9aa9bfdc2aac6001708a751165ca86de26d
+++ libpurple/group.c	03ba27bae35be42a7983906555a63a9e992d31e6
@@ -325,7 +325,7 @@ enum {
 	PROP_LAST
 };
 
-#define PROP_NAME_S ("name")
+#define PROP_NAME_S "name"
 
 PurpleGroup *purple_group_new(const char *name)
 {
@@ -389,7 +389,9 @@ purple_group_class_init(PurpleGroupClass
 {
 	GObjectClass *obj_class = G_OBJECT_CLASS(klass);
 
-	parent_class = PURPLE_BLIST_NODE_CLASS(klass);	
+	g_type_class_add_private(klass, sizeof(PurpleGroupPrivate));
+
+	parent_class = PURPLE_BLIST_NODE_CLASS(klass);
 	parent_class->add_sibling = purple_group_add_sibling;
 	parent_class->add_child = purple_group_add_child;
 	parent_class->remove = purple_group_remove_node;
@@ -403,7 +405,7 @@ purple_group_class_init(PurpleGroupClass
 	g_object_class_install_property(obj_class, PROP_NAME,
 			g_param_spec_string(PROP_NAME_S, _("Name"),
 				_("The name for the group."), NULL,
-				G_PARAM_READABLE | G_PARAM_CONSTRUCT_ONLY)
+				G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY)
 			);
 }
 
============================================================
--- libpurple/ghash.c	0229a7cecc9f2cd1e844157aa8f44be94f4c411a
+++ libpurple/ghash.c	f790d218d3662c9c6c763325a00930611697e744
@@ -58,6 +58,9 @@ purple_g_hash_set_checksum_type(PurpleGH
 	PurpleGHashPrivate *priv = PURPLE_G_HASH_GET_PRIVATE(cipher);
 
 	priv->type = type;
+	if (priv->checksum)
+		g_checksum_free(priv->checksum);
+	priv->checksum = g_checksum_new(type);
 }
 
 /******************************************************************************
@@ -152,9 +155,6 @@ purple_g_hash_finalize(GObject *obj) {
 purple_g_hash_finalize(GObject *obj) {
 	PurpleGHashPrivate *priv = PURPLE_G_HASH_GET_PRIVATE(obj);
 
-#if GLIB_CHECK_VERSION(2,18,0)
-	g_checksum_reset(priv->checksum);
-#endif
 	g_checksum_free(priv->checksum);
 	priv->checksum = NULL;
 
@@ -207,7 +207,7 @@ purple_g_hash_get_type(void) {
 			NULL
 		};
 
-		type = g_type_register_static(G_TYPE_OBJECT,
+		type = g_type_register_static(PURPLE_TYPE_CIPHER,
 									  "PurpleGHash",
 									  &info, G_TYPE_FLAG_ABSTRACT);
 	}


More information about the Commits mailing list