Commit 8a00bb36 authored by Lubomir Rintel's avatar Lubomir Rintel 🥕

nm-settings: add nm_settings_has_connection()

Useful for checking if a connection is already deleted.

https://bugzilla.gnome.org/show_bug.cgi?id=744812
https://bugzilla.redhat.com/show_bug.cgi?id=1174164
parent cd2cef9c
......@@ -467,6 +467,21 @@ notify (GObject *object, GParamSpec *pspec)
g_slice_free (GValue, value);
}
gboolean
nm_settings_has_connection (NMSettings *self, NMConnection *connection)
{
NMSettingsPrivate *priv = NM_SETTINGS_GET_PRIVATE (self);
GHashTableIter iter;
gpointer data;
g_hash_table_iter_init (&iter, priv->connections);
while (g_hash_table_iter_next (&iter, NULL, &data))
if (data == connection)
return TRUE;
return FALSE;
}
const GSList *
nm_settings_get_unmanaged_specs (NMSettings *self)
{
......
......@@ -111,6 +111,8 @@ NMSettingsConnection *nm_settings_get_connection_by_path (NMSettings *settings,
NMSettingsConnection *nm_settings_get_connection_by_uuid (NMSettings *settings,
const char *uuid);
gboolean nm_settings_has_connection (NMSettings *self, NMConnection *connection);
const GSList *nm_settings_get_unmanaged_specs (NMSettings *self);
char *nm_settings_get_hostname (NMSettings *self);
......
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