keyfile/trival: move code

(cherry picked from commit f41586f00c)
This commit is contained in:
Thomas Haller 2014-12-08 21:11:52 +01:00
parent 6f5c18f8fa
commit 09e88d1d45

View file

@ -100,6 +100,23 @@ remove_connection (SCPluginKeyfile *self, NMKeyfileConnection *connection)
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
update_connection (SCPluginKeyfile *self,
NMKeyfileConnection *connection,
@ -136,23 +153,6 @@ update_connection (SCPluginKeyfile *self,
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
new_connection (SCPluginKeyfile *self,
const char *name,