Commit 89c1007f authored by Thomas Haller's avatar Thomas Haller

libnm: implement nm_client_reload_connections() by using GDBusConnection directly

parent 4af62192
......@@ -2210,13 +2210,26 @@ nm_client_reload_connections (NMClient *client,
GCancellable *cancellable,
GError **error)
{
gs_unref_variant GVariant *ret = NULL;
g_return_val_if_fail (NM_IS_CLIENT (client), FALSE);
g_return_val_if_fail (!cancellable || G_IS_CANCELLABLE (cancellable), FALSE);
if (!_nm_client_check_nm_running (client, error))
ret = _nm_object_dbus_call_sync (client,
cancellable,
NM_DBUS_PATH_SETTINGS,
NM_DBUS_INTERFACE_SETTINGS,
"ReloadConnections",
g_variant_new ("()"),
G_VARIANT_TYPE ("(b)"),
G_DBUS_CALL_FLAGS_NONE,
NM_DBUS_DEFAULT_TIMEOUT_MSEC,
TRUE,
error);
if (!ret)
return FALSE;
return nm_remote_settings_reload_connections (NM_CLIENT_GET_PRIVATE (client)->settings,
cancellable, error);
return TRUE;
}
static void
......
......@@ -394,28 +394,6 @@ nm_remote_settings_add_connection2 (NMRemoteSettings *self,
}
}
gboolean
nm_remote_settings_reload_connections (NMRemoteSettings *settings,
GCancellable *cancellable,
GError **error)
{
NMRemoteSettingsPrivate *priv;
gboolean success;
g_return_val_if_fail (NM_IS_REMOTE_SETTINGS (settings), FALSE);
priv = NM_REMOTE_SETTINGS_GET_PRIVATE (settings);
if (!nmdbus_settings_call_reload_connections_sync (priv->proxy, &success,
cancellable, error)) {
if (error && *error)
g_dbus_error_strip_remote_error (*error);
return FALSE;
}
return TRUE;
}
static void
reload_connections_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
{
......
......@@ -75,11 +75,6 @@ void nm_remote_settings_add_connection2 (NMRemoteSettings *self,
NMRemoteSettingAddConnection2Callback callback,
gpointer user_data);
_NM_DEPRECATED_SYNC_METHOD_INTERNAL
gboolean nm_remote_settings_reload_connections (NMRemoteSettings *settings,
GCancellable *cancellable,
GError **error);
void nm_remote_settings_reload_connections_async (NMRemoteSettings *settings,
GCancellable *cancellable,
GAsyncReadyCallback callback,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment