cpw.gillux.detachablepurple: ac878635: Fixed the object path creation code, and...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Mon May 14 23:27:03 EDT 2012


----------------------------------------------------------------------
Revision: ac8786356f427d2f3a57233219efa1852471f021
Parent:   2a84ab02517d2f281b127a2d5eca272e52cbd1b9
Author:   gillux at soc.pidgin.im
Date:     05/14/12 23:19:18
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/ac8786356f427d2f3a57233219efa1852471f021

Changelog: 

Fixed the object path creation code, and added the call to
purple_dbus_assoc_gobject() so that clients can lookup object paths.

Changes against parent 2a84ab02517d2f281b127a2d5eca272e52cbd1b9

  patched  libpurple/pobject.c

-------------- next part --------------
============================================================
--- libpurple/pobject.c	1366bf549dfe18a2e1800e9e29729f365d1fb202
+++ libpurple/pobject.c	e3d1d2a0015bd80e1f9d2982c7895d573d08a67f
@@ -363,8 +363,7 @@ purple_object_get_dbus_path(PurpleObject
 	priv = PURPLE_OBJECT_GET_PRIVATE(pobj);
 	pclass = PURPLE_OBJECT_GET_CLASS(pobj);
 	if (!priv->dbus_path && pclass->build_dbus_path(pobj)) {
-		/* Let's try to build it. */
-		priv->dbus_path = pclass->build_dbus_path(pobj);
+		purple_object_set_dbus_path(pobj, pclass->build_dbus_path(pobj));
 	}
 	return priv->dbus_path;
 }
@@ -376,9 +375,15 @@ purple_object_set_dbus_path(PurpleObject
 
 	g_return_if_fail(pobj);
 	priv = PURPLE_OBJECT_GET_PRIVATE(pobj);
-	if (priv->dbus_path)
+	if (priv->dbus_path) {
+		purple_dbus_disassoc_gobject(priv->dbus_path);
 		g_free(priv->dbus_path);
+	}
 	priv->dbus_path = g_strdup(path);
+
+	/* In remote mode, we need to keep track of the object paths. */
+	if (purple_core_is_remote_mode())
+		purple_dbus_assoc_gobject(path, G_OBJECT(pobj));
 }
 
 void


More information about the Commits mailing list