mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-29 12:40:11 +01: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
This commit is contained in:
parent
cd2cef9cab
commit
8a00bb36ec
2 changed files with 17 additions and 0 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue