cpw.gillux.detachablepurple: f7a0f2c1: Moved and renamed the D-Bus path names #...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Tue May 29 12:11:24 EDT 2012


----------------------------------------------------------------------
Revision: f7a0f2c1d5127bed496bedfdedc4d7c64e0342a3
Parent:   7f873e7b7e7e971e207960fd09ab7e3cc1af9e9c
Author:   gillux at soc.pidgin.im
Date:     05/29/12 11:38:45
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/f7a0f2c1d5127bed496bedfdedc4d7c64e0342a3

Changelog: 

Moved and renamed the D-Bus path names #define's.
Putting these in public headers is only relevant for well-known names.
Otherwise we keep them private in the .c file.

Changes against parent 7f873e7b7e7e971e207960fd09ab7e3cc1af9e9c

  patched  libpurple/dbus/account.c
  patched  libpurple/dbus/blist.c
  patched  libpurple/dbus/buddy.c
  patched  libpurple/dbus/chat.c
  patched  libpurple/dbus/connection.c
  patched  libpurple/dbus/contact.c
  patched  libpurple/dbus/group.c
  patched  libpurple/dbus-purple.h
  patched  libpurple/dbus-server.h

-------------- next part --------------
============================================================
--- libpurple/dbus-purple.h	f7bfd5ba5dabefd7b472f221af3ed65267a9e1f1
+++ libpurple/dbus-purple.h	fd2d262a0d83787a3914b15db02c86e6d13fa1db
@@ -29,31 +29,22 @@
 #define DBUS_INTERFACE_PURPLE    "im.pidgin.purple.PurpleInterface"
 
 #define DBUS_PURPLE_SERVICE	"im.pidgin.purple"
-#define DBUS_ACCOUNT_PATH	"/im/pidgin/purple/account"
 #define DBUS_ACCOUNT_INTERFACE    "im.pidgin.purple.account"
 
-#define DBUS_BLIST_PATH      "/im/pidgin/purple/blist"
 #define DBUS_BLIST_INTERFACE "im.pidgin.purple.blist"
 
-#define DBUS_BUDDY_PATH      "/im/pidgin/purple/buddy"
 #define DBUS_BUDDY_INTERFACE "im.pidgin.purple.buddy"
 
-#define DBUS_CHAT_PATH      "/im/pidgin/purple/chat"
 #define DBUS_CHAT_INTERFACE "im.pidgin.purple.chat"
 
-#define DBUS_CONNECTION_PATH      "/im/pidgin/purple/connection"
 #define DBUS_CONNECTION_INTERFACE "im.pidgin.purple.connection"
 
-#define DBUS_CONTACT_PATH      "/im/pidgin/purple/contact"
 #define DBUS_CONTACT_INTERFACE "im.pidgin.purple.contact"
 
-#define DBUS_GROUP_PATH      "/im/pidgin/purple/group"
 #define DBUS_GROUP_INTERFACE "im.pidgin.purple.group"
 
-#define DBUS_CONSTRUCTOR_PATH      "/im/pidgin/purple/constructor"
 #define DBUS_CONSTRUCTOR_INTERFACE "im.pidgin.purple.constructor"
 
-#define DBUS_CALLBACK_PATH      "/im/pidgin/purple/callback"
 #define DBUS_CALLBACK_INTERFACE "im.pidgin.purple.callback"
 
 #endif /* _DBUS_PURPLE_H_ */
============================================================
--- libpurple/dbus-server.h	2820ba0ad924ff2a9494adc630528b543b51de4c
+++ libpurple/dbus-server.h	cd219d1e8fee4807f640505938ff10a03736b475
@@ -91,6 +91,11 @@ struct _PurpleDBusType {
 
 #define DBUS_TIMEOUT_MSEC (20 * 1000)
 
+/** Well-known D-Bus path names. */
+#define DBUS_CONSTRUCTOR_PATH          "/im/pidgin/purple/constructor"
+#define DBUS_CALLBACK_PATH             "/im/pidgin/purple/callback"
+#define DBUS_BLIST_PATH                "/im/pidgin/purple/blist"
+
 /**
    Initializes purple dbus pointer registration engine.
 
============================================================
--- libpurple/dbus/account.c	270a635d0386f8f3b3e293afb282f166f872615a
+++ libpurple/dbus/account.c	f7851b71a9bf68a2227823f736901941441ab2c6
@@ -35,6 +35,8 @@ static GVariant *account_unregister_cb(P
 /* D-Bus methods and callbacks implementations. */
 static GVariant *account_unregister_cb(PurpleAccount *account, gboolean have_callback);
 
+#define DBUS_ACCOUNT_BASEPATH "/im/pidgin/purple/account"
+
 /**
  * Callback called on the client when the user accepted an auth request.
  * It runs the RunRequest method on the daemon, with the original request id,
@@ -112,7 +114,7 @@ purple_account_build_dbus_path(PurpleObj
 	id2 = purple_dbus_sanitize_dbus_path(id);
 	g_free(id);
 
-	id = g_strjoin("/", DBUS_ACCOUNT_PATH, id2, NULL);
+	id = g_strjoin("/", DBUS_ACCOUNT_BASEPATH, id2, NULL);
         g_free(id2);
 
         return id;
============================================================
--- libpurple/dbus/connection.c	d16150ac1634f4b559238161120d68084655d750
+++ libpurple/dbus/connection.c	1a9101cdcde6cea30d009b14347d627940b675a2
@@ -28,6 +28,8 @@
 #include "dbus-purple.h"
 #include "pobject.h"
 
+#define DBUS_CONNECTION_BASEPATH "/im/pidgin/purple/connection"
+
 static char*
 purple_connection_build_dbus_path(PurpleObject *pobject)
 {
@@ -40,7 +42,7 @@ purple_connection_build_dbus_path(Purple
 
 	username = purple_account_get_username(account);
 	proto = purple_account_get_protocol_id(account);
-	path = g_strjoin("/", DBUS_CONNECTION_PATH, proto, username, NULL);
+	path = g_strjoin("/", DBUS_CONNECTION_BASEPATH, proto, username, NULL);
 	path_valid = purple_dbus_sanitize_dbus_path(path);
 	g_free(path);
 
============================================================
--- libpurple/dbus/blist.c	c623a9ad02c1d0bb50666a2d98ebed5105b0a915
+++ libpurple/dbus/blist.c	0a04216f217f93f42fac1332d616b59ccfb96838
@@ -29,7 +29,7 @@
 #include "dbus/blist.xml.h"
 #include "dbus/constructor.h"
 #include "dbus-maybe.h"
-#include "dbus-purple.h"
+#include "dbus-server.h"
 
 /* The type PurpleBuddyList is only defined in libpurple/blist.c. While we
  * don't strictly need it, we use it here and there for the sake of
============================================================
--- libpurple/dbus/group.c	f4ddf3dc838880cf1deed4f0766445bbda4608c5
+++ libpurple/dbus/group.c	3b71ec22a705e9e1ee2cafd3a43def3d07be7b4a
@@ -28,6 +28,8 @@
 #include "dbus-server.h"
 #include "pobject.h"
 
+#define DBUS_GROUP_BASEPATH "/im/pidgin/purple/group"
+
 static char *
 purple_group_build_dbus_path(PurpleObject *pobject)
 {
@@ -43,10 +45,10 @@ purple_group_build_dbus_path(PurpleObjec
 	 * meaningful, since groups are rarely renamed. */
 	if (name) {
 		name_valid = purple_dbus_sanitize_dbus_path(name);
-		path = g_strdup_printf(DBUS_GROUP_PATH "/%u_%s", group_id++, name_valid);
+		path = g_strdup_printf(DBUS_GROUP_BASEPATH "/%u_%s", group_id++, name_valid);
 		g_free(name_valid);
 	} else {
-		path = g_strdup_printf(DBUS_GROUP_PATH "/%u", group_id++);
+		path = g_strdup_printf(DBUS_GROUP_BASEPATH "/%u", group_id++);
 	}
 
 	return path;
============================================================
--- libpurple/dbus/contact.c	84e050d4f165b3db7ef436b0a1878a16920150ea
+++ libpurple/dbus/contact.c	7ab2f7a862d838c28052d8d74eb288c0915124ed
@@ -28,6 +28,8 @@
 #include "dbus-server.h"
 #include "pobject.h"
 
+#define DBUS_CONTACT_BASEPATH "/im/pidgin/purple/contact"
+
 static char *
 purple_contact_build_dbus_path(PurpleObject *pobj)
 {
@@ -35,7 +37,7 @@ purple_contact_build_dbus_path(PurpleObj
 
 	/* Contacts have nothing unique nor that identify themselves
 	 * at the time they are created. So we use a poor id. */
-	return g_strdup_printf(DBUS_CONTACT_PATH "/%u", contact_id++);
+	return g_strdup_printf(DBUS_CONTACT_BASEPATH "/%u", contact_id++);
 }
 
 static void
============================================================
--- libpurple/dbus/buddy.c	9b6d5e65ae2f6661f30f141a92bee34098122677
+++ libpurple/dbus/buddy.c	52451bef5ae0f2923976428249599d02bc5f4676
@@ -28,6 +28,8 @@
 #include "dbus-server.h"
 #include "pobject.h"
 
+#define DBUS_BUDDY_BASEPATH "/im/pidgin/purple/buddy"
+
 static char *
 purple_buddy_build_dbus_path(PurpleObject *pobject)
 {
@@ -42,10 +44,10 @@ purple_buddy_build_dbus_path(PurpleObjec
 	 * name, to make a meaningful path. */
 	if (name) {
 		name_valid = purple_dbus_sanitize_dbus_path(name);
-		path = g_strdup_printf(DBUS_BUDDY_PATH "/%u_%s", buddy_id++, name_valid);
+		path = g_strdup_printf(DBUS_BUDDY_BASEPATH "/%u_%s", buddy_id++, name_valid);
 		g_free(name_valid);
 	} else {
-		path = g_strdup_printf(DBUS_BUDDY_PATH "/%u", buddy_id++);
+		path = g_strdup_printf(DBUS_BUDDY_BASEPATH "/%u", buddy_id++);
 	}
 
 	return path;
============================================================
--- libpurple/dbus/chat.c	0764a2b82db053fafd980d3966c6d838f8dbe560
+++ libpurple/dbus/chat.c	48814453edc428d4265ca69f0d418cdb6701a639
@@ -29,13 +29,15 @@
 #include "dbus-server.h"
 #include "pobject.h"
 
+#define DBUS_CHAT_BASEPATH "/im/pidgin/purple/chat"
+
 static char *
 purple_chat_build_dbus_path(PurpleObject *pobject)
 {
 	static unsigned int chat_id = 0;
 
 	/* There is nothing to identify chats but this internal id. */
-	return g_strdup_printf(DBUS_CHAT_PATH "/%u", chat_id++);
+	return g_strdup_printf(DBUS_CHAT_BASEPATH "/%u", chat_id++);
 }
 
 static void


More information about the Commits mailing list