2007-09-20 Dan Williams <dcbw@redhat.com>

* introspection/nm-settings-connection.xml
	  libnm-glib/nm-settings.c
	  libnm-glib/nm-settings.h
		- Make GetSecrets asynchronous on the server side



git-svn-id: http://svn-archive.gnome.org/svn/NetworkManager/trunk@2829 4912f4e0-d625-0410-9fb7-b9a5a253dbdc
This commit is contained in:
Dan Williams 2007-09-20 09:22:42 +00:00
parent e6dae7aeed
commit 174d339a34
4 changed files with 29 additions and 14 deletions

View file

@ -1,3 +1,10 @@
2007-09-20 Dan Williams <dcbw@redhat.com>
* introspection/nm-settings-connection.xml
libnm-glib/nm-settings.c
libnm-glib/nm-settings.h
- Make GetSecrets asynchronous on the server side
2007-09-20 Dan Williams <dcbw@redhat.com>
* src/nm-manager.h

View file

@ -16,6 +16,7 @@
<method name="GetSecrets">
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_connection_settings_get_secrets"/>
<annotation name="org.freedesktop.DBus.GLib.Async" value=""/>
<arg name="setting_name" type="s" direction="in"/>
<arg name="secrets" type="a{sv}" direction="out"/>
</method>

View file

@ -115,10 +115,9 @@ static gboolean impl_connection_settings_get_id (NMConnectionSettings *connectio
static gboolean impl_connection_settings_get_settings (NMConnectionSettings *connection,
GHashTable **settings,
GError **error);
static gboolean impl_connection_settings_get_secrets (NMConnectionSettings *connection,
static void impl_connection_settings_get_secrets (NMConnectionSettings *connection,
const gchar *setting_name,
GHashTable **secrets,
GError **error);
DBusGMethodInvocation *context);
#include "nm-settings-connection-glue.h"
@ -169,22 +168,28 @@ impl_connection_settings_get_settings (NMConnectionSettings *connection,
return TRUE;
}
static gboolean
static void
impl_connection_settings_get_secrets (NMConnectionSettings *connection,
const gchar *setting_name,
GHashTable **secrets,
GError **error)
const gchar *setting_name,
DBusGMethodInvocation *context)
{
g_return_val_if_fail (NM_IS_CONNECTION_SETTINGS (connection), FALSE);
GError *error = NULL;
if (!CONNECTION_SETTINGS_CLASS (connection)->get_secrets) {
*error = new_error ("%s.%d - Missing implementation for ConnectionSettings::get_secret.", __FILE__, __LINE__);
return FALSE;
if (!NM_IS_CONNECTION_SETTINGS (connection)) {
error = new_error ("%s.%d - Invalid connection in ConnectionSettings::get_secret.", __FILE__, __LINE__);
dbus_g_method_return_error (context, error);
g_error_free (error);
return;
}
*secrets = CONNECTION_SETTINGS_CLASS (connection)->get_secrets (connection, setting_name);
if (!CONNECTION_SETTINGS_CLASS (connection)->get_secrets) {
error = new_error ("%s.%d - Missing implementation for ConnectionSettings::get_secret.", __FILE__, __LINE__);
dbus_g_method_return_error (context, error);
g_error_free (error);
return;
}
return TRUE;
CONNECTION_SETTINGS_CLASS (connection)->get_secrets (connection, setting_name, context);
}
static guint32 cs_counter = 0;

View file

@ -27,7 +27,9 @@ typedef struct {
/* virtual methods */
gchar * (* get_id) (NMConnectionSettings *connection);
GHashTable * (* get_settings) (NMConnectionSettings *connection);
GHashTable * (* get_secrets) (NMConnectionSettings *connection, const gchar *setting_name);
void (* get_secrets) (NMConnectionSettings *connection,
const gchar *setting_name,
DBusGMethodInvocation *context);
/* signals */
void (* updated) (NMConnectionSettings *connection, GHashTable *settings);