mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 18:50:07 +01:00
settings: make nm_settings_connection_replace_and_commit() virtual
This commit is contained in:
parent
bd2deace70
commit
5a229741cc
2 changed files with 23 additions and 8 deletions
|
|
@ -527,17 +527,14 @@ ignore_cb (NMSettingsConnection *connection,
|
|||
* subsystems watching this connection. Before returning, 'callback' is run
|
||||
* with the given 'user_data' along with any errors encountered.
|
||||
*/
|
||||
void
|
||||
nm_settings_connection_replace_and_commit (NMSettingsConnection *self,
|
||||
NMConnection *new_connection,
|
||||
NMSettingsConnectionCommitFunc callback,
|
||||
gpointer user_data)
|
||||
static void
|
||||
replace_and_commit (NMSettingsConnection *self,
|
||||
NMConnection *new_connection,
|
||||
NMSettingsConnectionCommitFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
GError *error = NULL;
|
||||
|
||||
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self));
|
||||
g_return_if_fail (NM_IS_CONNECTION (new_connection));
|
||||
|
||||
if (nm_settings_connection_replace_settings (self, new_connection, TRUE, &error)) {
|
||||
nm_settings_connection_commit_changes (self, callback, user_data);
|
||||
} else {
|
||||
|
|
@ -547,6 +544,18 @@ nm_settings_connection_replace_and_commit (NMSettingsConnection *self,
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
nm_settings_connection_replace_and_commit (NMSettingsConnection *self,
|
||||
NMConnection *new_connection,
|
||||
NMSettingsConnectionCommitFunc callback,
|
||||
gpointer user_data)
|
||||
{
|
||||
g_return_if_fail (NM_IS_SETTINGS_CONNECTION (self));
|
||||
g_return_if_fail (NM_IS_CONNECTION (new_connection));
|
||||
|
||||
NM_SETTINGS_CONNECTION_GET_CLASS (self)->replace_and_commit (self, new_connection, callback, user_data);
|
||||
}
|
||||
|
||||
static void
|
||||
commit_changes (NMSettingsConnection *self,
|
||||
NMSettingsConnectionCommitFunc callback,
|
||||
|
|
@ -2362,6 +2371,7 @@ nm_settings_connection_class_init (NMSettingsConnectionClass *class)
|
|||
object_class->get_property = get_property;
|
||||
object_class->set_property = set_property;
|
||||
|
||||
class->replace_and_commit = replace_and_commit;
|
||||
class->commit_changes = commit_changes;
|
||||
class->delete = do_delete;
|
||||
class->supports_secrets = supports_secrets;
|
||||
|
|
|
|||
|
|
@ -103,6 +103,11 @@ struct _NMSettingsConnectionClass {
|
|||
GObjectClass parent;
|
||||
|
||||
/* virtual methods */
|
||||
void (*replace_and_commit) (NMSettingsConnection *connection,
|
||||
NMConnection *new_connection,
|
||||
NMSettingsConnectionCommitFunc callback,
|
||||
gpointer user_data);
|
||||
|
||||
void (*commit_changes) (NMSettingsConnection *connection,
|
||||
NMSettingsConnectionCommitFunc callback,
|
||||
gpointer user_data);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue