mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-05-08 22:58:16 +02:00
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
(cherry picked from commit 8a00bb36ec)
This commit is contained in:
parent
12a68c9e99
commit
a4369ef841
2 changed files with 17 additions and 0 deletions
|
|
@ -468,6 +468,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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue