/srv/mercurial-server/detachablepurple: fec931dd25ea: Fixed the ...

Gilles Bedel gillux at cpw.pidgin.im
Fri Jun 15 22:01:36 EDT 2012


Changeset: fec931dd25eaf23f769f869a6dd0a74965789aa0
Author:	 Gilles Bedel <gillux at cpw.pidgin.im>
Date:	 2012-05-15 03:19 +0000
Branch:	 cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/fec931dd25ea

Description:

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

diffstat:

 libpurple/pobject.c |  11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diffs (30 lines):

diff --git a/libpurple/pobject.c b/libpurple/pobject.c
--- a/libpurple/pobject.c
+++ b/libpurple/pobject.c
@@ -363,8 +363,7 @@
 	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 @@
 
 	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