mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 19:00:16 +01:00
parent
6f5c18f8fa
commit
09e88d1d45
1 changed files with 17 additions and 17 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue