/srv/mercurial-server/detachablepurple: 1e1e41d9f451: Updated Pu...

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


Changeset: 1e1e41d9f45187f3698252ff1b0563b797d111a2
Author:	 Gilles Bedel <gillux at cpw.pidgin.im>
Date:	 2012-05-20 17:07 +0000
Branch:	 cpw.gillux.detachablepurple
URL: http://hg.pidgin.im/srv/mercurial-server/detachablepurple/rev/1e1e41d9f451

Description:

Updated PurpleAccount according to the new gdbus-based API.

diffstat:

 libpurple/dbus/account.c |  49 ++++++++---------------------------------------
 libpurple/dbus/account.h |  28 +--------------------------
 2 files changed, 10 insertions(+), 67 deletions(-)

diffs (137 lines):

diff --git a/libpurple/dbus/account.c b/libpurple/dbus/account.c
--- a/libpurple/dbus/account.c
+++ b/libpurple/dbus/account.c
@@ -189,7 +189,9 @@
 {
 	PurpleObjectClass *pobjclass = PURPLE_OBJECT_CLASS(klass);
 
-	pobjclass->dbus_ifaceinfo = &purple_account_interface_info;
+	/* Register our interface. */
+	purple_object_class_register_dbus_iface(pobjclass, PURPLE_TYPE_ACCOUNT,
+	                                       &purple_account_interface_info);
 	pobjclass->dbus_init = purple_account_dbus_init;
 	if (purple_core_is_daemon_mode()) {
 		pobjclass->build_dbus_path = purple_account_build_dbus_path;
@@ -250,55 +252,22 @@
 void
 purple_account_connect_RPC(PurpleAccount* account)
 {
-	DBusGProxy* proxy;
-	GError *error = NULL;
-
-	proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(account));
-	if (!im_pidgin_purple_account_connect(proxy, &error))
-		PURPLE_RPC_FAILED(purple_account_connect, error);
-}
-
-gboolean
-DBUS_purple_account_connect(PurpleAccount *account, GError** error)
-{
-	purple_account_connect(account);
-	return TRUE;
+	purple_object_dbus_call(PURPLE_OBJECT(account),
+	                        purple_account_interface_info.name, "Connect");
 }
 
 void
 purple_account_disconnect_RPC(PurpleAccount* account)
 {
-	DBusGProxy* proxy;
-	GError *error = NULL;
-
-	proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(account));
-	if (!im_pidgin_purple_account_disconnect(proxy, &error))
-		PURPLE_RPC_FAILED(purple_account_disconnect, error);
-}
-
-gboolean
-DBUS_purple_account_disconnect(PurpleAccount *account, GError** error)
-{
-	purple_account_disconnect(account);
-	return TRUE;
+	purple_object_dbus_call(PURPLE_OBJECT(account),
+	                        purple_account_interface_info.name, "Disconnect");
 }
 
 void
 purple_account_register_RPC(PurpleAccount* account)
 {
-	DBusGProxy* proxy;
-	GError *error = NULL;
-
-	proxy = purple_object_get_dbus_obj_proxy(PURPLE_OBJECT(account));
-	if (!im_pidgin_purple_account_register(proxy, &error))
-		PURPLE_RPC_FAILED(purple_account_register, error);
-}
-
-gboolean
-DBUS_purple_account_register(PurpleAccount *account, GError** error)
-{
-	purple_account_register(account);
-	return TRUE;
+	purple_object_dbus_call(PURPLE_OBJECT(account),
+	                        purple_account_interface_info.name, "Register");
 }
 
 void
diff --git a/libpurple/dbus/account.h b/libpurple/dbus/account.h
--- a/libpurple/dbus/account.h
+++ b/libpurple/dbus/account.h
@@ -36,56 +36,30 @@
 void purple_account_connect_RPC(PurpleAccount* account);
 
 /**
- * Server side purple_account_connect() wrapper.
- */
-gboolean DBUS_purple_account_connect(PurpleAccount *account, GError** error);
-
-/**
  * Client side purple_account_disconnect() wrapper.
  */
 void purple_account_disconnect_RPC(PurpleAccount* account);
 
 /**
- * Server side purple_account_disconnect() wrapper.
- */
-gboolean DBUS_purple_account_disconnect(PurpleAccount *account, GError** error);
-
-/**
  * Client side purple_account_register() wrapper.
  */
 void purple_account_register_RPC(PurpleAccount* account);
 
 /**
- * Server side purple_account_register() wrapper.
- */
-gboolean DBUS_purple_account_register(PurpleAccount *account, GError** error);
-
-/**
  * Client side purple_account_set_status_list() wrapper.
  */
 void purple_account_set_status_list_RPC(PurpleAccount *account, const char *status_id, gboolean active, GList *attrs);
 
 /**
- * Server side purple_account_set_status_list() wrapper.
- */
-gboolean DBUS_purple_account_set_status_list(PurpleAccount *account, char *status_id, gboolean active, GPtrArray* attrs, GError** error);
-
-/**
  * Client side purple_account_unregister() wrapper.
  */
 void purple_account_unregister_RPC(PurpleAccount *account, PurpleAccountUnregistrationCb cb, void *user_data);
 
-/**
- * Server side purple_account_unregister() wrapper.
- */
-gboolean DBUS_purple_account_unregister(PurpleAccount *account, gboolean have_callback, guint64 *callback_id, GError** error);
-
 G_END_DECLS
 
 #else /* !HAVE_DBUS */
 
-#define purple_account_class_dbus_init()              ((void)0)
-#define purple_account_dbus_init(acc)                 ((void)0)
+#define purple_account_class_dbus_init(klass)         ((void)0)
 #define purple_account_connect_RPC(account)           ((void)0)
 #define purple_account_disconnect_RPC(account)        ((void)0)
 #define purple_account_register_RPC(account)          ((void)0)



More information about the Commits mailing list