/srv/mercurial-server/detachablepurple: 9a91688de27c: Basic upda...

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


Changeset: 9a91688de27cfcc8f7e3641805393fa9ac7da879
Author:	 Gilles Bedel <gillux at cpw.pidgin.im>
Date:	 2012-05-12 19:41 +0000
Branch:	 cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/9a91688de27c

Description:

Basic update of PurpleConstructor according to the new gdbus-based API.

diffstat:

 libpurple/dbus/constructor.c |  27 ++++++++++++++++-----------
 1 files changed, 16 insertions(+), 11 deletions(-)

diffs (62 lines):

diff --git a/libpurple/dbus/constructor.c b/libpurple/dbus/constructor.c
--- a/libpurple/dbus/constructor.c
+++ b/libpurple/dbus/constructor.c
@@ -29,8 +29,7 @@
 #include "accountlist.h"
 #include "connection.h"
 #include "dbus/constructor.h"
-#include "dbus/constructor-client.h"
-#include "dbus/constructor-server.h"
+#include "dbus/constructor.xml.h"
 #include "dbus-maybe.h"
 #include "debug.h"
 #include "marshallers.h"
@@ -77,6 +76,14 @@
 		G_TYPE_STRING, DBUS_COLLECTION_PROPS, G_TYPE_INVALID) \
 )
 
+static GVariant* purple_constructor_get_all_accounts(void);
+
+static char*
+purple_constructor_build_dbus_path(PurpleObject *object)
+{
+	return g_strdup(DBUS_CONSTRUCTOR_PATH);
+}
+
 /**
  * Callback called when we receive a dbus "PurpleConnectionCreated" signal.
  */
@@ -101,15 +108,15 @@
 
 static void purple_constructor_class_init(PurpleConstructorClass *klass)
 {
+	PurpleObjectClass *pobjclass = PURPLE_OBJECT_CLASS(klass);
+
+	pobjclass->dbus_ifaceinfo = &purple_constructor_interface_info;
+	/* Both client and daemon can build this well-known name. */
+	pobjclass->build_dbus_path = purple_constructor_build_dbus_path;
 	if (purple_core_is_daemon_mode()) {
 		/**
 		 * Add dbus stuff to this gobject.
-		 * dbus_glib_DBUS_purple_constructor_object_info is defined in
-		 * dbus-constructor-server.h, which is autogenerated.
 		 */
-		purple_object_type_install_dbus_infos(PURPLE_TYPE_CONSTRUCTOR,
-						&dbus_glib_DBUS_purple_constructor_object_info);
-
 		g_signal_new("purple_connection_created", PURPLE_TYPE_CONSTRUCTOR,
 					G_SIGNAL_RUN_LAST, 0, NULL, NULL,
 					purple_smarshal_VOID__STRING_BOOLEAN_STRING,
@@ -153,10 +160,8 @@
 		self = g_object_new(PURPLE_TYPE_CONSTRUCTOR, NULL);
 		klass = g_type_class_peek(PURPLE_TYPE_CONSTRUCTOR);
 		klass->instance = self;
-		purple_object_install_dbus_infos(
-					PURPLE_OBJECT(self),
-					DBUS_CONSTRUCTOR_INTERFACE,
-					DBUS_CONSTRUCTOR_PATH);
+
+		purple_dbus_connect_object(self);
 		if (purple_core_is_remote_mode() || purple_core_is_mirror_mode()) {
 			/* Connect our sighandlers */
 			proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(self));



More information about the Commits mailing list