<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
<node>
<interface name="com.google.code.AccountsSSO.gSingleSignOn.RemotePlugin">
+ <property type='s' name='method' access='read'/>
+ <property type='as' name='mechanisms' access='read'/>
<method name="cancel">
</method>
<method name="requestInitial">
<method name="refresh">
<arg name="uiData" type="a{sv}" direction="in"/>
</method>
- <method name="getInfo">
- <arg name="type" type="s" direction="out"/>
- <arg name="mechanisms" type="as" direction="out"/>
- </method>
<signal name="response">
<arg name="sessionData" type="a{sv}" direction="out"/>
switch (property_id) {
case PROP_TYPE: {
- if (!self->priv->plugin_type) {
- GError *error = NULL;
- gsignond_dbus_remote_plugin_call_get_info_sync (
- self->priv->dbus_plugin_proxy, &self->priv->plugin_type,
- &self->priv->plugin_mechanisms, NULL, &error);
- if (error) {
- DBG ("Plugin type retrieval error :: %s", error->message);
- g_error_free (error);
- if (self->priv->plugin_type) {
- g_free (self->priv->plugin_type);
- self->priv->plugin_type = NULL;
- }
- }
- }
- g_value_set_string (value, self->priv->plugin_type);
+ g_value_set_string (value,
+ gsignond_dbus_remote_plugin_get_method(self->priv->dbus_plugin_proxy));
break;
}
case PROP_MECHANISMS: {
- if (!self->priv->plugin_mechanisms) {
- GError *error = NULL;
- gsignond_dbus_remote_plugin_call_get_info_sync (
- self->priv->dbus_plugin_proxy, &self->priv->plugin_type,
- &self->priv->plugin_mechanisms, NULL, &error);
- if (error) {
- DBG ("Plugin mechanisms retrieval error :: %s",
- error->message);
- g_error_free (error);
- if (self->priv->plugin_mechanisms) {
- g_strfreev (self->priv->plugin_mechanisms);
- self->priv->plugin_mechanisms = NULL;
- }
- }
- }
- g_value_set_boxed (value, self->priv->plugin_mechanisms);
+ g_value_set_boxed (value,
+ gsignond_dbus_remote_plugin_get_mechanisms(self->priv->dbus_plugin_proxy));
break;
}
default:
static void
gsignond_plugin_remote_finalize (GObject *object)
{
- GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (object);
-
- if (self->priv->plugin_type) {
- g_free (self->priv->plugin_type);
- self->priv->plugin_type = NULL;
- }
-
- if (self->priv->plugin_mechanisms) {
- g_strfreev (self->priv->plugin_mechanisms);
- self->priv->plugin_mechanisms = NULL;
- }
+ //GSignondPluginRemote *self = GSIGNOND_PLUGIN_REMOTE (object);
G_OBJECT_CLASS (gsignond_plugin_remote_parent_class)->finalize (object);
}
self->priv->connection = NULL;
self->priv->dbus_plugin_proxy = NULL;
- self->priv->plugin_type = NULL;
- self->priv->plugin_mechanisms = NULL;
self->priv->cpid = 0;
self->priv->err_watch_ch = NULL;
plugin->priv->dbus_plugin_proxy =
gsignond_dbus_remote_plugin_proxy_new_sync (
plugin->priv->connection,
- G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES,
+ G_DBUS_PROXY_FLAGS_NONE,
NULL,
GSIGNOND_PLUGIN_OBJECTPATH,
NULL,
return TRUE;
}
-static gboolean
-_handle_get_info_from_dbus (
- GSignondPluginDaemon *self,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- DBG ("");
- g_return_val_if_fail (self && GSIGNOND_IS_PLUGIN_DAEMON (self), FALSE);
- gchar *type = NULL;
- gchar **mechanisms = NULL;
-
- g_object_get (self->priv->plugin, "type", &type, "mechanisms", &mechanisms,
- NULL);
- gsignond_dbus_remote_plugin_complete_get_info (
- self->priv->dbus_remote_plugin, invocation, (const gchar*)type,
- (const gchar *const *)mechanisms);
- g_free (type);
- g_strfreev (mechanisms);
- return TRUE;
-}
-
static void
_handle_response_from_plugin (
GSignondPluginDaemon *self,
G_CALLBACK(_handle_user_action_finished_from_dbus), daemon);
g_signal_connect_swapped (daemon->priv->dbus_remote_plugin,
"handle-refresh", G_CALLBACK(_handle_refresh_from_dbus), daemon);
- g_signal_connect_swapped (daemon->priv->dbus_remote_plugin,
- "handle-get-info", G_CALLBACK(_handle_get_info_from_dbus), daemon);
/* Connect plugin signals to handlers */
g_signal_connect_swapped (daemon->priv->plugin, "response",
g_signal_connect (daemon->priv->connection, "closed",
G_CALLBACK(_on_connection_closed), daemon);
+ /* Set DBus properties */
+ gchar* type;
+ gchar** mechanisms;
+
+ g_object_get(daemon->priv->plugin, "type", &type, "mechanisms", &mechanisms, NULL);
+ gsignond_dbus_remote_plugin_set_method(daemon->priv->dbus_remote_plugin, type);
+ gsignond_dbus_remote_plugin_set_mechanisms(daemon->priv->dbus_remote_plugin, (const gchar* const*) mechanisms);
+
+ g_free(type);
+ g_strfreev(mechanisms);
+
g_dbus_connection_start_message_processing (daemon->priv->connection);
return daemon;