Commit d2064be7 authored by Thomas Haller's avatar Thomas Haller

core/dispatcher: add and use nm_dispatcher_call_hostname()

parent 2b72cc26
......@@ -693,6 +693,27 @@ done:
return success;
}
/**
* nm_dispatcher_call_hostname:
* @callback: a caller-supplied callback to execute when done
* @user_data: caller-supplied pointer passed to @callback
* @out_call_id: on success, a call identifier which can be passed to
* nm_dispatcher_call_cancel()
*
* This method always invokes the dispatcher action asynchronously.
*
* Returns: %TRUE if the action was dispatched, %FALSE on failure
*/
gboolean
nm_dispatcher_call_hostname (NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id)
{
return _dispatcher_call (NM_DISPATCHER_ACTION_HOSTNAME, FALSE, NULL, NULL, NULL,
NM_CONNECTIVITY_UNKNOWN, NULL, NULL, NULL, NULL,
callback, user_data, out_call_id);
}
/**
* nm_dispatcher_call:
* @action: the %NMDispatcherAction
......
......@@ -41,6 +41,10 @@ typedef enum {
typedef void (*NMDispatcherFunc) (guint call_id, gpointer user_data);
gboolean nm_dispatcher_call_hostname (NMDispatcherFunc callback,
gpointer user_data,
guint *out_call_id);
gboolean nm_dispatcher_call (NMDispatcherAction action,
NMSettingsConnection *settings_connection,
NMConnection *applied_connection,
......
......@@ -428,7 +428,7 @@ settings_set_hostname_cb (const char *hostname,
}
if (!ret)
nm_dispatcher_call (NM_DISPATCHER_ACTION_HOSTNAME, NULL, NULL, NULL, NULL, NULL, NULL);
nm_dispatcher_call_hostname (NULL, NULL, NULL);
}
static void
......
......@@ -2143,7 +2143,7 @@ hostnamed_properties_changed (GDBusProxy *proxy,
g_free (priv->hostname.value);
priv->hostname.value = g_strdup (hostname);
_notify (self, PROP_HOSTNAME);
nm_dispatcher_call (NM_DISPATCHER_ACTION_HOSTNAME, NULL, NULL, NULL, NULL, NULL, NULL);
nm_dispatcher_call_hostname (NULL, NULL, NULL);
}
g_variant_unref (v_hostname);
......
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