cpw.gillux.detachablepurple: 73e0c7d4: Adapted PurpleAccount to use the new gdb...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Thu May 19 16:21:16 EDT 2011


----------------------------------------------------------------------
Revision: 73e0c7d4f6c1288146f17df7f344b318795b0c9b
Parent:   a8edb2e23ff931398eef101872430240da47d7cf
Author:   gillux at soc.pidgin.im
Date:     05/19/11 16:05:47
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/73e0c7d4f6c1288146f17df7f344b318795b0c9b

Changelog: 

Adapted PurpleAccount to use the new gdbus code.

Changes against parent a8edb2e23ff931398eef101872430240da47d7cf

  patched  libpurple/account.c
  patched  libpurple/dbus/account.c

-------------- next part --------------
============================================================
--- libpurple/account.c	0d0f3e17b21df17e3ef6f74d21b35ec266844789
+++ libpurple/account.c	a78a975c5c10255e0e1619149c4e3100b0d6c0f6
@@ -755,7 +755,7 @@ static void purple_account_class_init(Pu
 
 #warning TODO: Setup more signals
 
-	purple_account_class_dbus_init();
+	purple_account_class_dbus_init(klass);
 
 	g_type_class_add_private(klass, sizeof(PurpleAccountPrivate));
 }
============================================================
--- libpurple/dbus/account.c	767afc902247a45b355a5f64435e00d0b002447c
+++ libpurple/dbus/account.c	39187372150953abd234fe1464d0bce020a398ca
@@ -30,6 +30,10 @@
 #include "marshallers.h"
 #include "nullmarshaller.h"
 
+/* move this, later */
+#include <gio/gio.h>
+#include "account.xml.h"
+
 /**
  * Callback, called when we receive a dbus "NotifyAdded" signal.
  */
@@ -154,12 +158,24 @@ void
 }
 
 void
-purple_account_class_dbus_init(void)
+purple_account_class_dbus_init(PurpleAccountClass *klass)
 {
+	PurpleObjectClass *pobjclass = PURPLE_OBJECT_CLASS(klass);
 	if (purple_core_is_daemon_mode()) {
-		/* Install method introspection data */
-		purple_object_type_install_dbus_infos(PURPLE_TYPE_ACCOUNT,
-				&dbus_glib_DBUS_purple_account_object_info);
+		pobjclass->dbus_ifaceinfo = &_purple_account_interface_info;
+		purple_object_bind_dbus_method(pobjclass, "Connect",
+		                               (GCallback)purple_account_connect);
+		purple_object_bind_dbus_method(pobjclass, "Disconnect",
+		                               (GCallback)purple_account_disconnect);
+		purple_object_bind_dbus_method(pobjclass, "Register",
+		                               (GCallback)purple_account_register);
+/* Those are more complicated, we will handle them later.
+		purple_object_bind_dbus_method(PURPLE_OBJECT_CLASS(klass),
+		                               "Unregister",
+		                               (GCallback)purple_account_unregister);
+		purple_object_bind_dbus_method(pobjclass, "SetStatusList",
+		                               (GCallback)purple_account_set_status_list);
+*/
 
 		g_signal_new("notify_added",
 		             PURPLE_TYPE_ACCOUNT,
@@ -204,9 +220,11 @@ purple_account_dbus_init(PurpleAccount *
 	char* dbus_path;
         DBusGProxy* proxy;
 
+	if (purple_core_is_daemon_mode())
+		purple_dbus_register_object(account);
+
 	dbus_path = purple_account_build_dbus_path(username, protocol_id);
-	purple_object_install_dbus_infos(PURPLE_OBJECT(account),
-					DBUS_ACCOUNT_INTERFACE, dbus_path);
+	purple_object_set_dbus_path(PURPLE_OBJECT(account), dbus_path);
 	g_free(dbus_path);	
 
 	if (purple_core_is_remote_mode() || purple_core_is_mirror_mode()) {


More information about the Commits mailing list