summaryrefslogtreecommitdiff
path: root/src/supplicant-manager
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2016-06-17 11:40:50 +0200
committerThomas Haller <thaller@redhat.com>2016-06-17 12:25:33 +0200
commitbc1014a93df6defd91ee7de37cca4d0c4842d7f1 (patch)
treea7e4e13a7a25ed9c434ff44d38d48db93a53b24c /src/supplicant-manager
parentcaeaa789185b78d5fd88b4e7d61e0a517ae97175 (diff)
all: replace _nm_utils_string_in_list() with g_strv_contains()
Diffstat (limited to 'src/supplicant-manager')
-rw-r--r--src/supplicant-manager/nm-supplicant-interface.c7
-rw-r--r--src/supplicant-manager/nm-supplicant-manager.c16
2 files changed, 14 insertions, 9 deletions
diff --git a/src/supplicant-manager/nm-supplicant-interface.c b/src/supplicant-manager/nm-supplicant-interface.c
index ce7a2a2c9..59e0ef390 100644
--- a/src/supplicant-manager/nm-supplicant-interface.c
+++ b/src/supplicant-manager/nm-supplicant-interface.c
@@ -385,10 +385,11 @@ parse_capabilities (NMSupplicantInterface *self, GVariant *capabilities)
g_return_if_fail (capabilities && g_variant_is_of_type (capabilities, G_VARIANT_TYPE_VARDICT));
- if (g_variant_lookup (capabilities, "Scan", "^a&s", &array)) {
- if (_nm_utils_string_in_list ("active", array))
+ if ( g_variant_lookup (capabilities, "Scan", "^a&s", &array)
+ && array) {
+ if (g_strv_contains (array, "active"))
have_active = TRUE;
- if (_nm_utils_string_in_list ("ssid", array))
+ if (g_strv_contains (array, "ssid"))
have_ssid = TRUE;
g_free (array);
}
diff --git a/src/supplicant-manager/nm-supplicant-manager.c b/src/supplicant-manager/nm-supplicant-manager.c
index f2c63364f..57cd57131 100644
--- a/src/supplicant-manager/nm-supplicant-manager.c
+++ b/src/supplicant-manager/nm-supplicant-manager.c
@@ -194,9 +194,11 @@ update_capabilities (NMSupplicantManager *self)
if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING_ARRAY)) {
array = g_variant_get_strv (value, NULL);
priv->ap_support = NM_SUPPLICANT_FEATURE_NO;
- if (_nm_utils_string_in_list ("ap", array))
- priv->ap_support = NM_SUPPLICANT_FEATURE_YES;
- g_free (array);
+ if (array) {
+ if (g_strv_contains (array, "ap"))
+ priv->ap_support = NM_SUPPLICANT_FEATURE_YES;
+ g_free (array);
+ }
}
g_variant_unref (value);
}
@@ -215,9 +217,11 @@ update_capabilities (NMSupplicantManager *self)
if (value) {
if (g_variant_is_of_type (value, G_VARIANT_TYPE_STRING_ARRAY)) {
array = g_variant_get_strv (value, NULL);
- if (_nm_utils_string_in_list ("fast", array))
- priv->fast_supported = TRUE;
- g_free (array);
+ if (array) {
+ if (g_strv_contains (array, "fast"))
+ priv->fast_supported = TRUE;
+ g_free (array);
+ }
}
g_variant_unref (value);
}