diff options
| author | Michael Biebl <biebl@debian.org> | 2011-05-04 21:35:57 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2011-05-04 21:35:57 +0200 |
| commit | 3241555aff5c969104e492501097f4cb8837bcca (patch) | |
| tree | 6d15a02d02a9f1bfcda6075ae2b8c71537d8038d /src/nm-device-wifi.c | |
| parent | e1b66c145e71e7bc6a06845dd17788fb7b8e158e (diff) | |
| parent | 9f806e97a24bba61417ae312fcc0da40914266fb (diff) | |
Merge commit 'upstream/0.8.999' into experimental
Diffstat (limited to 'src/nm-device-wifi.c')
| -rw-r--r-- | src/nm-device-wifi.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/nm-device-wifi.c b/src/nm-device-wifi.c index 626c2c0d..9258f77c 100644 --- a/src/nm-device-wifi.c +++ b/src/nm-device-wifi.c @@ -1390,9 +1390,9 @@ real_complete_connection (NMDevice *device, const GByteArray *ssid = NULL; GSList *iter; - s_wifi = (NMSettingWireless *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS); - s_wsec = (NMSettingWirelessSecurity *) nm_connection_get_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY); - s_8021x = (NMSetting8021x *) nm_connection_get_setting (connection, NM_TYPE_SETTING_802_1X); + s_wifi = nm_connection_get_setting_wireless (connection); + s_wsec = nm_connection_get_setting_wireless_security (connection); + s_8021x = nm_connection_get_setting_802_1x (connection); if (!specific_object) { /* If not given a specific object, we need at minimum an SSID */ @@ -1430,8 +1430,10 @@ real_complete_connection (NMDevice *device, gboolean valid; settings = g_slist_prepend (settings, s_wifi); - settings = g_slist_prepend (settings, s_wsec); - settings = g_slist_prepend (settings, s_8021x); + if (s_wsec) + settings = g_slist_prepend (settings, s_wsec); + if (s_8021x) + settings = g_slist_prepend (settings, s_8021x); valid = nm_setting_verify (NM_SETTING (s_wifi), settings, error); g_slist_free (settings); if (!valid) @@ -1449,6 +1451,12 @@ real_complete_connection (NMDevice *device, } } + /* Add a wifi setting if one doesn't exist yet */ + if (!s_wifi) { + s_wifi = (NMSettingWireless *) nm_setting_wireless_new (); + nm_connection_add_setting (connection, NM_SETTING (s_wifi)); + } + if (ap) { ssid = nm_ap_get_ssid (ap); |