cpw.gillux.detachablepurple: ff0195be: Going multi-interface, adapted PurpleAcc...

gillux at soc.pidgin.im gillux at soc.pidgin.im
Sun May 20 13:22:12 EDT 2012


----------------------------------------------------------------------
Revision: ff0195be20179f01429f6638940cb1d1ca2f0d6c
Parent:   a30254e0f9f7f16880b99a3f89a401f8724ed47b
Author:   gillux at soc.pidgin.im
Date:     05/20/12 10:55:56
Branch:   im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/ff0195be20179f01429f6638940cb1d1ca2f0d6c

Changelog: 

Going multi-interface, adapted PurpleAccount, PurpleConnection
and PurpleConstructor accordingly.

Changes against parent a30254e0f9f7f16880b99a3f89a401f8724ed47b

  patched  libpurple/dbus/account.c
  patched  libpurple/dbus/connection.c
  patched  libpurple/dbus/constructor.c

-------------- next part --------------
============================================================
--- libpurple/dbus/account.c	9a744e2c53f8f5d591c13dfb70bc1c2bc91297f5
+++ libpurple/dbus/account.c	1456b14216d2df5423193b78f98c157ca3e92a9d
@@ -193,12 +193,15 @@ purple_account_class_dbus_init(PurpleAcc
 	pobjclass->dbus_init = purple_account_dbus_init;
 	if (purple_core_is_daemon_mode()) {
 		pobjclass->build_dbus_path = purple_account_build_dbus_path;
-		purple_object_bind_dbus_callback(pobjclass, "Connect",
-		                                 (GCallback)purple_account_connect);
-		purple_object_bind_dbus_callback(pobjclass, "Disconnect",
-		                                 (GCallback)purple_account_disconnect);
-		purple_object_bind_dbus_callback(pobjclass, "Register",
-		                                 (GCallback)purple_account_register);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_account_interface_info.name,
+		   "Connect", (GCallback)purple_account_connect);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_account_interface_info.name,
+		   "Disconnect", (GCallback)purple_account_disconnect);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_account_interface_info.name,
+		   "Register", (GCallback)purple_account_register);
 /* Those are more complicated, we will handle them later.
 		purple_object_bind_dbus_method(PURPLE_OBJECT_CLASS(klass),
 		                               "Unregister",
============================================================
--- libpurple/dbus/constructor.c	1c41b809b856abb18ae62a79f0704d521801359d
+++ libpurple/dbus/constructor.c	4a9452c142ed3f65af22845ac95e8084885fff3c
@@ -80,20 +80,25 @@ static void purple_constructor_class_ini
 {
 	PurpleObjectClass *pobjclass = PURPLE_OBJECT_CLASS(klass);
 
-	pobjclass->dbus_ifaceinfo = &purple_constructor_interface_info;
+	/* Register our interface. */
+	purple_object_class_register_dbus_iface(pobjclass, PURPLE_TYPE_CONSTRUCTOR,
+	                                        &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()) {
 		/* D-Bus method handlers. */
-		purple_object_bind_dbus_callback(pobjclass, "GetAllAccounts",
-		                                 (GCallback)purple_constructor_get_all_accounts);
-		purple_object_bind_dbus_callback(pobjclass, "NewAccount",
-		                                 (GCallback)purple_constructor_new_account);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_constructor_interface_info.name,
+		   "GetAllAccounts", (GCallback)purple_constructor_get_all_accounts);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_constructor_interface_info.name,
+		   "NewAccount", (GCallback)purple_constructor_new_account);
 	}
 	else if (purple_core_is_remote_mode()) {
 		/* D-Bus signal handlers. */
-		purple_object_bind_dbus_callback(pobjclass, "PurpleObjectCreated",
-		                                 (GCallback)purple_constructor_pobj_created);
+		purple_object_bind_dbus_callback
+		  (pobjclass, purple_constructor_interface_info.name,
+		   "PurpleObjectCreated", (GCallback)purple_constructor_pobj_created);
 	}
 }
 
============================================================
--- libpurple/dbus/connection.c	279b335e1ea7a5d99feac0ded9118fd65febc90b
+++ libpurple/dbus/connection.c	d16150ac1634f4b559238161120d68084655d750
@@ -55,8 +55,6 @@ purple_connection_dbus_init(gpointer obj
 
 	/* Publish/listen for the object on the bus. */
 	purple_dbus_connect_object(gc);
-	/* Keep the properties synchronized between client and daemon. */
-	purple_object_dbus_bind_notify(pobject);
 
 	if (purple_core_is_daemon_mode()) {
 		/* Tell the clients about this new account. */
@@ -69,7 +67,10 @@ purple_connection_class_dbus_init(Purple
 {
 	PurpleObjectClass *pobjclass = PURPLE_OBJECT_CLASS(klass);
 
-	pobjclass->dbus_ifaceinfo = &purple_connection_interface_info;
+	/* Register our interface. */
+	purple_object_class_register_dbus_iface
+	  (pobjclass, PURPLE_TYPE_CONNECTION,
+	   &purple_connection_interface_info);
 	pobjclass->dbus_init = purple_connection_dbus_init;
 	if (purple_core_is_daemon_mode()) {
 		/* Only the daemon shall build path names,


More information about the Commits mailing list