summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2016-10-18 16:42:53 +0200
committerLubomir Rintel <lkundrak@v3.sk>2016-11-10 16:48:48 +0100
commitff3eb24c15154d2fa7aec9cb1882c63e83a65e70 (patch)
tree3aca7af39990174a5017a7048f068a891dd57071
parentbbed63213aa04b8c1296b597bc803a4af3b58682 (diff)
downloadNetworkManager-ff3eb24c15154d2fa7aec9cb1882c63e83a65e70.tar.gz
libnm: change the secret agent to use the generated GDBus bindings
It allows us to drop _nm_dbus_register_proxy_type() and _nm_dbus_new_proxy_*() once they're not used by the rest of libnm anymore.
-rw-r--r--libnm/nm-secret-agent-old.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/libnm/nm-secret-agent-old.c b/libnm/nm-secret-agent-old.c
index 1a078183ac..43e115e9b1 100644
--- a/libnm/nm-secret-agent-old.c
+++ b/libnm/nm-secret-agent-old.c
@@ -1047,19 +1047,20 @@ init_sync (GInitable *initable, GCancellable *cancellable, GError **error)
{
NMSecretAgentOld *self = NM_SECRET_AGENT_OLD (initable);
NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (self);
- GDBusProxy *proxy;
priv->bus = _nm_dbus_new_connection (cancellable, error);
if (!priv->bus)
return FALSE;
- proxy = _nm_dbus_new_proxy_for_connection (priv->bus,
- NM_DBUS_PATH_AGENT_MANAGER,
- NM_DBUS_INTERFACE_AGENT_MANAGER,
- cancellable, error);
- if (!proxy)
+ priv->manager_proxy = nmdbus_agent_manager_proxy_new_sync (priv->bus,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
+ | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ NM_DBUS_SERVICE,
+ NM_DBUS_PATH_AGENT_MANAGER,
+ cancellable,
+ error);
+ if (!priv->manager_proxy)
return FALSE;
- priv->manager_proxy = NMDBUS_AGENT_MANAGER (proxy);
init_common (self);
@@ -1106,15 +1107,13 @@ init_async_got_proxy (GObject *object, GAsyncResult *result, gpointer user_data)
{
NMSecretAgentOldInitData *init_data = user_data;
NMSecretAgentOldPrivate *priv = NM_SECRET_AGENT_OLD_GET_PRIVATE (init_data->self);
- GDBusProxy *proxy;
GError *error = NULL;
- proxy = _nm_dbus_new_proxy_for_connection_finish (result, &error);
- if (!proxy) {
+ priv->manager_proxy = nmdbus_agent_manager_proxy_new_finish (result, &error);
+ if (!priv->manager_proxy) {
init_async_complete (init_data, error);
return;
}
- priv->manager_proxy = NMDBUS_AGENT_MANAGER (proxy);
init_common (init_data->self);
@@ -1138,11 +1137,13 @@ init_async_got_bus (GObject *initable, GAsyncResult *result, gpointer user_data)
return;
}
- _nm_dbus_new_proxy_for_connection_async (priv->bus,
- NM_DBUS_PATH_AGENT_MANAGER,
- NM_DBUS_INTERFACE_AGENT_MANAGER,
- init_data->cancellable,
- init_async_got_proxy, init_data);
+ nmdbus_agent_manager_proxy_new (priv->bus,
+ G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
+ | G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
+ NM_DBUS_INTERFACE_AGENT_MANAGER,
+ NM_DBUS_PATH_AGENT_MANAGER,
+ init_data->cancellable,
+ init_async_got_proxy, init_data);
}
static void
@@ -1340,9 +1341,6 @@ nm_secret_agent_old_class_init (NMSecretAgentOldClass *class)
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT |
G_PARAM_STATIC_STRINGS));
-
- _nm_dbus_register_proxy_type (NM_DBUS_INTERFACE_AGENT_MANAGER,
- NMDBUS_TYPE_AGENT_MANAGER_PROXY);
}
static void