Commit 5a229741 authored by Dan Winship's avatar Dan Winship

settings: make nm_settings_connection_replace_and_commit() virtual

parent bd2deace
......@@ -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);
......
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