soc.2010.detachablepurple: d4c871b2: Allowed the internal dbus path of Purple...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Mon Aug 9 23:58:48 EDT 2010


----------------------------------------------------------------------
Revision: d4c871b2bf423d139c723623878d4b4e4379acd7
Parent:   51eab32d5bf613506ee24026925da51baa5cc171
Author:   gillux at soc.pidgin.im
Date:     08/09/10 23:33:04
Branch:   im.pidgin.soc.2010.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/d4c871b2bf423d139c723623878d4b4e4379acd7

Changelog: 

Allowed the internal dbus path of PurpleObjects not to be set on object
creation. This is needed by objects whose the dbus path is't guessable from
the construction parameters and have to be provided separately.
Also adapted such objects.

Changes against parent 51eab32d5bf613506ee24026925da51baa5cc171

  patched  libpurple/dbus/chat.c
  patched  libpurple/dbus/contact.c
  patched  libpurple/dbus/group.c
  patched  libpurple/pobject.c

-------------- next part --------------
============================================================
--- libpurple/pobject.c	03b2435f61709c430211384c09f052199e8ec893
+++ libpurple/pobject.c	7daf25fdedb1a5b9debe31b17abd6eb95a1aaee0
@@ -444,6 +444,11 @@ purple_object_install_dbus_infos(PurpleO
 	g_return_if_fail(pobj);
 	priv = PURPLE_OBJECT_GET_PRIVATE(pobj);
 
+	/* Note that this is not an error since sometimes the client just can't
+	 * guess the path name when the object is first created. */
+	if (!dbus_path)
+		return;
+
 	if (purple_core_is_remote_mode() || purple_core_is_mirror_mode()) {
 		/* One for the org.freedesktop.DBus.Properties interface */
 		dbus_proxy = dbus_g_proxy_new_for_name(
============================================================
--- libpurple/dbus/group.c	fbcb469c1ac5d833264a2aef642921a8c718b61c
+++ libpurple/dbus/group.c	6b6d688beec045fb42e9f93f9b840eae6169b798
@@ -35,6 +35,11 @@ purple_group_build_dbus_path(const char 
 	gchar *path;
 	gchar *name_valid;
 
+	/* In remote mode we have no way to build the object path.
+	 * We will set it later. */
+	if (purple_core_is_remote_mode())
+		return NULL;
+
 	/* Group names are unique but they can change, whereas dbus path names
 	 * can't. So we use an id, with the group name appended, to make it
 	 * meaningful, since groups are rarely renamed. */
============================================================
--- libpurple/dbus/contact.c	614ec07718f37f8521a88ba94fd54a9955e47163
+++ libpurple/dbus/contact.c	bed890c19349344f32d4448e40e73609e65129f7
@@ -35,6 +35,11 @@ purple_contact_build_dbus_path(void)
 	gchar *path;
 	gchar *path_valid;
 
+	/* In remote mode we have no way to build the object path.
+	 * We will set it later. */
+	if (purple_core_is_remote_mode())
+		return NULL;
+
 	/* Contacts have nothing unique nor that identify themselves
 	 * at the time they are created. So we use a poor id. */
 	path = g_strdup_printf(DBUS_CONTACT_PATH "/%u", contact_id++);
============================================================
--- libpurple/dbus/chat.c	051bd7975ad5503c7fb6358e4c85d9c919ae7d67
+++ libpurple/dbus/chat.c	4d7858d2e9b56671efa5802167f8a846f89f3c9e
@@ -33,6 +33,11 @@ purple_chat_build_dbus_path(void)
 {
 	static unsigned int chat_id = 0;
 
+	/* In remote mode we have no way to build the object path.
+	 * We will set it later. */
+	if (purple_core_is_remote_mode())
+		return NULL;
+
 	/* There is nothing to identify chats but this internal id. */
 	return g_strdup_printf(DBUS_CHAT_PATH "/%u", chat_id++);
 }


More information about the Commits mailing list