libnm-glib: NMSettingsInterface::add_connection() should take an NMConnection
instead of an NMSettingsConnectionInterface, because we won't always have an object that implements NMSettingsConnectionInterface. Plus, since NMConnection is a prerequisite of NMSettingsConnectionInterface, the NMConnection will always be there anyway.
This commit is contained in:
@@ -226,7 +226,7 @@ add_connection_done (DBusGProxy *proxy,
|
||||
|
||||
static gboolean
|
||||
add_connection (NMSettingsInterface *settings,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -240,7 +240,7 @@ add_connection (NMSettingsInterface *settings,
|
||||
info->callback = callback;
|
||||
info->callback_data = user_data;
|
||||
|
||||
new_settings = nm_connection_to_hash (NM_CONNECTION (connection));
|
||||
new_settings = nm_connection_to_hash (connection);
|
||||
org_freedesktop_NetworkManagerSettings_add_connection_async (priv->proxy,
|
||||
new_settings,
|
||||
add_connection_done,
|
||||
|
@@ -112,7 +112,7 @@ nm_settings_interface_get_connection_by_path (NMSettingsInterface *settings,
|
||||
/**
|
||||
* nm_settings_interface_add_connection:
|
||||
* @settings: a object implementing %NMSettingsInterface
|
||||
* @connection: the settings to add; note that this objects settings will be
|
||||
* @connection: the settings to add; note that this object's settings will be
|
||||
* added, not the object itself
|
||||
* @callback: callback to be called when the add operation completes
|
||||
* @user_data: caller-specific data passed to @callback
|
||||
@@ -123,14 +123,14 @@ nm_settings_interface_get_connection_by_path (NMSettingsInterface *settings,
|
||||
**/
|
||||
gboolean
|
||||
nm_settings_interface_add_connection (NMSettingsInterface *settings,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_val_if_fail (settings != NULL, FALSE);
|
||||
g_return_val_if_fail (NM_IS_SETTINGS_INTERFACE (settings), FALSE);
|
||||
g_return_val_if_fail (connection != NULL, FALSE);
|
||||
g_return_val_if_fail (NM_IS_SETTINGS_CONNECTION_INTERFACE (connection), FALSE);
|
||||
g_return_val_if_fail (NM_IS_CONNECTION (connection), FALSE);
|
||||
g_return_val_if_fail (callback != NULL, FALSE);
|
||||
|
||||
if (NM_SETTINGS_INTERFACE_GET_INTERFACE (settings)->add_connection) {
|
||||
|
@@ -67,7 +67,7 @@ struct _NMSettingsInterface {
|
||||
const char *path);
|
||||
|
||||
gboolean (*add_connection) (NMSettingsInterface *settings,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data);
|
||||
|
||||
@@ -85,7 +85,7 @@ NMSettingsConnectionInterface *nm_settings_interface_get_connection_by_path (NMS
|
||||
const char *path);
|
||||
|
||||
gboolean nm_settings_interface_add_connection (NMSettingsInterface *settings,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data);
|
||||
|
||||
|
@@ -143,7 +143,7 @@ nm_settings_service_get_connection_by_path (NMSettingsService *self,
|
||||
|
||||
static gboolean
|
||||
add_connection (NMSettingsInterface *settings,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
@@ -202,7 +202,7 @@ impl_settings_add_connection (NMSettingsService *self,
|
||||
|
||||
if (NM_SETTINGS_SERVICE_GET_CLASS (self)->add_connection) {
|
||||
NM_SETTINGS_SERVICE_GET_CLASS (self)->add_connection (NM_SETTINGS_SERVICE (self),
|
||||
NM_SETTINGS_CONNECTION_INTERFACE (tmp),
|
||||
tmp,
|
||||
context,
|
||||
dbus_add_connection_cb,
|
||||
context);
|
||||
|
@@ -52,7 +52,7 @@ typedef struct {
|
||||
GSList * (*list_connections) (NMSettingsService *self);
|
||||
|
||||
void (*add_connection) (NMSettingsService *self,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
DBusGMethodInvocation *context, /* Only present for D-Bus calls */
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data);
|
||||
|
@@ -643,7 +643,7 @@ out:
|
||||
|
||||
static void
|
||||
add_connection (NMSettingsService *service,
|
||||
NMSettingsConnectionInterface *connection,
|
||||
NMConnection *connection,
|
||||
DBusGMethodInvocation *context, /* Only present for D-Bus calls */
|
||||
NMSettingsAddConnectionFunc callback,
|
||||
gpointer user_data)
|
||||
@@ -663,7 +663,7 @@ add_connection (NMSettingsService *service,
|
||||
return;
|
||||
}
|
||||
|
||||
call = polkit_call_new (self, context, NM_CONNECTION (connection), callback, user_data, NULL);
|
||||
call = polkit_call_new (self, context, connection, callback, user_data, NULL);
|
||||
g_assert (call);
|
||||
polkit_authority_check_authorization (priv->authority,
|
||||
call->subject,
|
||||
|
Reference in New Issue
Block a user