cpw.gillux.detachablepurple: 33d90c06: PurpleAccount: cleaned up the remainings...
gillux at soc.pidgin.im
gillux at soc.pidgin.im
Fri May 25 15:46:51 EDT 2012
----------------------------------------------------------------------
Revision: 33d90c0682a2b9eed811d7ea05923d8fa7f029e2
Parent: 0ee4010839ed5289ead6ede5e484f9ec54ca92a9
Author: gillux at soc.pidgin.im
Date: 05/25/12 15:11:04
Branch: im.pidgin.cpw.gillux.detachablepurple
URL: http://d.pidgin.im/viewmtn/revision/info/33d90c0682a2b9eed811d7ea05923d8fa7f029e2
Changelog:
PurpleAccount: cleaned up the remainings of the dbus-glib code.
The "NotifyAdded" and "RequestAdd" D-Bus signals do not need
wrapper functions anymore, so they are ready.
Changes against parent 0ee4010839ed5289ead6ede5e484f9ec54ca92a9
patched libpurple/dbus/account.c
patched libpurple/dbus/account.xml
-------------- next part --------------
============================================================
--- libpurple/dbus/account.c 6c3132a77592246d6a220f2eda38c70b3102eaf5
+++ libpurple/dbus/account.c 082c90678016ed701210660e4c0bc9bb6d509604
@@ -22,11 +22,8 @@
#include "internal.h"
#include "account.h"
#include "dbus/account.h"
-#include "dbus/account-client.h"
-#include "dbus/account-server.h"
#include "dbus/callback.h"
#include "dbus/constructor.h"
-#include "dbus/constructor-client.h"
#include "dbus-maybe.h"
#include "marshallers.h"
#include "nullmarshaller.h"
@@ -35,31 +32,10 @@
#include <gio/gio.h>
#include "account.xml.h"
-/**
- * Callback, called when we receive a dbus "NotifyAdded" signal.
- */
-static void
-notify_added_cb(DBusGProxy *proxy, const char *remote_user, const char *id,
- const char *alias, const char *message, gpointer data)
-{
- PurpleAccount* account = PURPLE_ACCOUNT(
- purple_dbus_get_gobject_by_path(dbus_g_proxy_get_path(proxy)));
- purple_account_notify_added(account, remote_user, id, alias, message);
-}
+/* D-Bus methods and callbacks implementations. */
+static GVariant *account_unregister_cb(PurpleAccount *account, gboolean have_callback);
/**
- * Callback, called when we receive a dbus "RequestAdd" signal.
- */
-static void
-request_add_cb(DBusGProxy *proxy, const char *remote_user, const char *id,
- const char *alias, const char *message, gpointer data)
-{
- PurpleAccount* account = PURPLE_ACCOUNT(
- purple_dbus_get_gobject_by_path(dbus_g_proxy_get_path(proxy)));
- purple_account_request_add(account, remote_user, id, alias, message);
-}
-
-/**
* Callback called on the client when the user accepted an auth request.
* It runs the RunRequest method on the daemon, with the original request id,
* and the request choice number 1 (authorized).
@@ -207,32 +183,16 @@ purple_account_class_dbus_init(PurpleAcc
purple_object_bind_dbus_method(pobjclass, "SetStatusList",
(GCallback)purple_account_set_status_list);
*/
-
- g_signal_new("notify_added",
- PURPLE_TYPE_ACCOUNT,
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL,
- purple_smarshal_VOID__STRING_STRING_STRING_STRING,
- G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING);
- g_signal_new("request_add",
- PURPLE_TYPE_ACCOUNT,
- G_SIGNAL_RUN_LAST,
- 0, NULL, NULL,
- purple_smarshal_VOID__STRING_STRING_STRING_STRING,
- G_TYPE_NONE, 4, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING);
}
- /* In remote mode we need to register the marshallers
- * we will use to receive the signals sent by the daemon */
else if (purple_core_is_remote_mode()) {
- /* Marshaller for the NotifyAdded and RequestAdd dbus signals */
- dbus_g_object_register_marshaller(
- purple_smarshal_VOID__STRING_STRING_STRING_STRING,
- G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING,
- G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
purple_object_bind_dbus_callback
(pobjclass, purple_account_interface_info.name,
+ "NotifyAdded", (GCallback)purple_account_notify_added);
+ purple_object_bind_dbus_callback
+ (pobjclass, purple_account_interface_info.name,
+ "RequestAdd", (GCallback)purple_account_request_add);
+ purple_object_bind_dbus_callback
+ (pobjclass, purple_account_interface_info.name,
"RequestAuthorize", (GCallback)request_authorize_cb);
}
}
============================================================
--- libpurple/dbus/account.xml a9f17460767705da3631627f133b63b56b51cff2
+++ libpurple/dbus/account.xml efa2d1002d08caee546b98c262a84ffa73daf991
@@ -24,10 +24,6 @@
<arg type="av" name="attributes" direction="in" />
</method>
- <signal name="DBusNotify">
- <arg type="s" name="property-name" />
- <arg type="v" name="property-value" />
- </signal>
<signal name="NotifyAdded">
<arg type="s" name="remote_user" />
<arg type="s" name="id" />
More information about the Commits
mailing list