From 09e88d1d452bac61badc719a2fc377f439f82c36 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Mon, 8 Dec 2014 21:11:52 +0100 Subject: [PATCH] keyfile/trival: move code (cherry picked from commit f41586f00c0662d593328caa735ed9b26ac71c48) --- src/settings/plugins/keyfile/plugin.c | 34 +++++++++++++-------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/settings/plugins/keyfile/plugin.c b/src/settings/plugins/keyfile/plugin.c index e79ad551b8..f27aea9db3 100644 --- a/src/settings/plugins/keyfile/plugin.c +++ b/src/settings/plugins/keyfile/plugin.c @@ -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,