Commit f41586f0 authored by Thomas Haller's avatar Thomas Haller

keyfile/trival: move code

parent fbd30c7d
...@@ -100,6 +100,23 @@ remove_connection (SCPluginKeyfile *self, NMKeyfileConnection *connection) ...@@ -100,6 +100,23 @@ remove_connection (SCPluginKeyfile *self, NMKeyfileConnection *connection)
g_return_if_fail (removed); g_return_if_fail (removed);
} }
static NMKeyfileConnection *
find_by_path (SCPluginKeyfile *self, const char *path)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
GHashTableIter iter;
NMSettingsConnection *candidate = NULL;
g_return_val_if_fail (path != NULL, NULL);
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &candidate)) {
if (g_strcmp0 (path, nm_settings_connection_get_filename (candidate)) == 0)
return NM_KEYFILE_CONNECTION (candidate);
}
return NULL;
}
static void static void
update_connection (SCPluginKeyfile *self, update_connection (SCPluginKeyfile *self,
NMKeyfileConnection *connection, NMKeyfileConnection *connection,
...@@ -136,23 +153,6 @@ update_connection (SCPluginKeyfile *self, ...@@ -136,23 +153,6 @@ update_connection (SCPluginKeyfile *self,
g_object_unref (tmp); g_object_unref (tmp);
} }
static NMKeyfileConnection *
find_by_path (SCPluginKeyfile *self, const char *path)
{
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
GHashTableIter iter;
NMSettingsConnection *candidate = NULL;
g_return_val_if_fail (path != NULL, NULL);
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, (gpointer) &candidate)) {
if (g_strcmp0 (path, nm_settings_connection_get_filename (candidate)) == 0)
return NM_KEYFILE_CONNECTION (candidate);
}
return NULL;
}
static void static void
new_connection (SCPluginKeyfile *self, new_connection (SCPluginKeyfile *self,
const char *name, const char *name,
......
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