keyfile: use nm_connection_get_id() and nm_connection_get_uuid()
This commit is contained in:
@@ -77,7 +77,6 @@ _internal_new_connection (SCPluginKeyfile *self,
|
|||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
|
SCPluginKeyfilePrivate *priv = SC_PLUGIN_KEYFILE_GET_PRIVATE (self);
|
||||||
NMSettingConnection *s_con;
|
|
||||||
const char *cid, *uuid;
|
const char *cid, *uuid;
|
||||||
NMKeyfileConnection *connection;
|
NMKeyfileConnection *connection;
|
||||||
|
|
||||||
@@ -87,13 +86,9 @@ _internal_new_connection (SCPluginKeyfile *self,
|
|||||||
if (!connection)
|
if (!connection)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
s_con = (NMSettingConnection *) nm_connection_get_setting (NM_CONNECTION (connection),
|
cid = nm_connection_get_id (NM_CONNECTION (connection));
|
||||||
NM_TYPE_SETTING_CONNECTION);
|
|
||||||
g_assert (s_con);
|
|
||||||
|
|
||||||
cid = nm_setting_connection_get_id (s_con);
|
|
||||||
g_assert (cid);
|
g_assert (cid);
|
||||||
uuid = nm_setting_connection_get_uuid (s_con);
|
uuid = nm_connection_get_uuid (NM_CONNECTION (connection));
|
||||||
g_assert (uuid);
|
g_assert (uuid);
|
||||||
|
|
||||||
g_hash_table_insert (priv->hash,
|
g_hash_table_insert (priv->hash,
|
||||||
@@ -199,11 +194,8 @@ find_by_uuid (SCPluginKeyfile *self, const char *uuid)
|
|||||||
g_hash_table_iter_init (&iter, priv->hash);
|
g_hash_table_iter_init (&iter, priv->hash);
|
||||||
while (g_hash_table_iter_next (&iter, NULL, &data)) {
|
while (g_hash_table_iter_next (&iter, NULL, &data)) {
|
||||||
NMConnection *candidate = NM_CONNECTION (data);
|
NMConnection *candidate = NM_CONNECTION (data);
|
||||||
NMSettingConnection *s_con;
|
|
||||||
|
|
||||||
s_con = (NMSettingConnection *) nm_connection_get_setting (candidate, NM_TYPE_SETTING_CONNECTION);
|
if (strcmp (uuid, nm_connection_get_uuid (candidate)) == 0)
|
||||||
g_assert (s_con);
|
|
||||||
if (strcmp (uuid, nm_setting_connection_get_uuid (s_con)) == 0)
|
|
||||||
return NM_KEYFILE_CONNECTION (candidate);
|
return NM_KEYFILE_CONNECTION (candidate);
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
|
Reference in New Issue
Block a user