cpw.gillux.detachablepurple: d463ee65: Basic update of PurpleConstructor accord...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sat May 12 16:56:41 EDT 2012


----------------------------------------------------------------------
Revision: d463ee6521874098ff99fcd5585b9ed4ae453739
Parent:   019763f28ca2acf1714396ce527933fe87b39ae7
Author:   gillux at soc.pidgin.im
Date:     05/12/12 15:41:51
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/d463ee6521874098ff99fcd5585b9ed4ae453739

Changelog: 

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

Changes against parent 019763f28ca2acf1714396ce527933fe87b39ae7

  patched  libpurple/dbus/constructor.c

-------------- next part --------------
============================================================
--- libpurple/dbus/constructor.c	8def14e5a6bd609bad29b83bb0b262b3d46c5b6f
+++ libpurple/dbus/constructor.c	1380e91ead82f2ac7053453f30fca9072c48dd88
@@ -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_DEFINE_TYPE(PurpleConstructor, purple_
 		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_ini
 
 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 @@ purple_constructor_get_instance(void)
 		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