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:
@@ -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>
|
2007-09-20 Dan Williams <dcbw@redhat.com>
|
||||||
|
|
||||||
* src/nm-manager.h
|
* src/nm-manager.h
|
||||||
|
@@ -16,6 +16,7 @@
|
|||||||
|
|
||||||
<method name="GetSecrets">
|
<method name="GetSecrets">
|
||||||
<annotation name="org.freedesktop.DBus.GLib.CSymbol" value="impl_connection_settings_get_secrets"/>
|
<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="setting_name" type="s" direction="in"/>
|
||||||
<arg name="secrets" type="a{sv}" direction="out"/>
|
<arg name="secrets" type="a{sv}" direction="out"/>
|
||||||
</method>
|
</method>
|
||||||
|
@@ -115,10 +115,9 @@ static gboolean impl_connection_settings_get_id (NMConnectionSettings *connectio
|
|||||||
static gboolean impl_connection_settings_get_settings (NMConnectionSettings *connection,
|
static gboolean impl_connection_settings_get_settings (NMConnectionSettings *connection,
|
||||||
GHashTable **settings,
|
GHashTable **settings,
|
||||||
GError **error);
|
GError **error);
|
||||||
static gboolean impl_connection_settings_get_secrets (NMConnectionSettings *connection,
|
static void impl_connection_settings_get_secrets (NMConnectionSettings *connection,
|
||||||
const gchar *setting_name,
|
const gchar *setting_name,
|
||||||
GHashTable **secrets,
|
DBusGMethodInvocation *context);
|
||||||
GError **error);
|
|
||||||
|
|
||||||
#include "nm-settings-connection-glue.h"
|
#include "nm-settings-connection-glue.h"
|
||||||
|
|
||||||
@@ -169,22 +168,28 @@ impl_connection_settings_get_settings (NMConnectionSettings *connection,
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static void
|
||||||
impl_connection_settings_get_secrets (NMConnectionSettings *connection,
|
impl_connection_settings_get_secrets (NMConnectionSettings *connection,
|
||||||
const gchar *setting_name,
|
const gchar *setting_name,
|
||||||
GHashTable **secrets,
|
DBusGMethodInvocation *context)
|
||||||
GError **error)
|
|
||||||
{
|
{
|
||||||
g_return_val_if_fail (NM_IS_CONNECTION_SETTINGS (connection), FALSE);
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!CONNECTION_SETTINGS_CLASS (connection)->get_secrets) {
|
if (!NM_IS_CONNECTION_SETTINGS (connection)) {
|
||||||
*error = new_error ("%s.%d - Missing implementation for ConnectionSettings::get_secret.", __FILE__, __LINE__);
|
error = new_error ("%s.%d - Invalid connection in ConnectionSettings::get_secret.", __FILE__, __LINE__);
|
||||||
return FALSE;
|
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;
|
static guint32 cs_counter = 0;
|
||||||
|
@@ -27,7 +27,9 @@ typedef struct {
|
|||||||
/* virtual methods */
|
/* virtual methods */
|
||||||
gchar * (* get_id) (NMConnectionSettings *connection);
|
gchar * (* get_id) (NMConnectionSettings *connection);
|
||||||
GHashTable * (* get_settings) (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 */
|
/* signals */
|
||||||
void (* updated) (NMConnectionSettings *connection, GHashTable *settings);
|
void (* updated) (NMConnectionSettings *connection, GHashTable *settings);
|
||||||
|
Reference in New Issue
Block a user