[network-manager-applet] all: don't use deprecated 802-11-wireless.security property



commit 94bc06fa65b6dd96c99f7f0c1cac5ca1a8669330
Author: Jiří Klimeš <jklimes redhat com>
Date:   Wed Aug 28 09:23:08 2013 +0200

    all: don't use deprecated 802-11-wireless.security property
    
    The security is identified by presence of 802-11-wireless-security setting.

 src/applet-device-wifi.c                   |    1 -
 src/applet-dialogs.c                       |    8 +++-----
 src/connection-editor/page-wifi-security.c |    9 ---------
 src/connection-editor/page-wifi.c          |    7 -------
 src/gconf-helpers/gconf-upgrade.c          |    2 --
 src/libnm-gtk/nm-wifi-dialog.c             |   10 ----------
 src/wireless-security/wireless-security.c  |    6 ------
 src/wireless-security/ws-leap.c            |    6 ------
 src/wireless-security/ws-wep-key.c         |    6 ------
 src/wireless-security/ws-wpa-psk.c         |    2 --
 10 files changed, 3 insertions(+), 54 deletions(-)
---
diff --git a/src/applet-device-wifi.c b/src/applet-device-wifi.c
index a54585e..eb09ed3 100644
--- a/src/applet-device-wifi.c
+++ b/src/applet-device-wifi.c
@@ -430,7 +430,6 @@ _do_new_auto_connection (NMApplet *applet,
                }
                g_object_set (s_wifi,
                              NM_SETTING_WIRELESS_SSID, ssid,
-                             NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME,
                              NULL);
 
                s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
diff --git a/src/applet-dialogs.c b/src/applet-dialogs.c
index 34506af..5d990f6 100644
--- a/src/applet-dialogs.c
+++ b/src/applet-dialogs.c
@@ -230,14 +230,12 @@ create_info_label_security (NMConnection *connection)
                NMSettingWireless *s_wireless;
                NMSettingWirelessSecurity *s_wireless_sec;
                NMSetting8021x *s_8021x;
-               const char *security;
 
                s_wireless = nm_connection_get_setting_wireless (connection);
                s_wireless_sec = nm_connection_get_setting_wireless_security (connection);
                s_8021x = nm_connection_get_setting_802_1x (connection);
-               security = s_wireless ? nm_setting_wireless_get_security (s_wireless) : NULL;
 
-               if (security && !strcmp (security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME) && 
s_wireless_sec) {
+               if (s_wireless_sec) {
                        const char *key_mgmt = nm_setting_wireless_security_get_key_mgmt (s_wireless_sec);
 
                        if (!strcmp (key_mgmt, "none"))
@@ -249,7 +247,7 @@ create_info_label_security (NMConnection *connection)
                        else
                                label = get_eap_label (s_wireless_sec, s_8021x);
                } else {
-                       label = g_strdup (C_("Wifi/wired security", "None"));
+                       label = g_strdup (C_("Wi-Fi/Ethernet security", "None"));
                }
        } else if (!strcmp (connection_type, NM_SETTING_WIRED_SETTING_NAME)) {
                NMSetting8021x *s_8021x;
@@ -258,7 +256,7 @@ create_info_label_security (NMConnection *connection)
                if (s_8021x)
                        label = get_eap_label (NULL, s_8021x);
                else
-                       label = g_strdup (C_("Wifi/wired security", "None"));
+                       label = g_strdup (C_("Wi-Fi/Ethernet security", "None"));
        }
 
        if (label)
diff --git a/src/connection-editor/page-wifi-security.c b/src/connection-editor/page-wifi-security.c
index 7f9e2cd..bd4e918 100644
--- a/src/connection-editor/page-wifi-security.c
+++ b/src/connection-editor/page-wifi-security.c
@@ -221,7 +221,6 @@ finish_setup (CEPageWifiSecurity *self, gpointer unused, GError *error, gpointer
        GtkListStore *sec_model;
        GtkTreeIter iter;
        const char *mode;
-       const char *security;
        guint32 dev_caps = 0;
        NMUtilsSecurityType default_type = NMU_SEC_NONE;
        int active = -1;
@@ -251,9 +250,6 @@ finish_setup (CEPageWifiSecurity *self, gpointer unused, GError *error, gpointer
 
        s_wireless_sec = nm_connection_get_setting_wireless_security (connection);
 
-       security = nm_setting_wireless_get_security (s_wireless);
-       if (!security || strcmp (security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME))
-               s_wireless_sec = NULL;
        if (s_wireless_sec)
                default_type = get_default_type_for_security (s_wireless_sec);
 
@@ -389,7 +385,6 @@ ce_page_wifi_security_new (NMConnection *connection,
        NMSettingWireless *s_wireless;
        NMSettingWirelessSecurity *s_wsec = NULL;
        NMUtilsSecurityType default_type = NMU_SEC_NONE;
-       const char *security;
 
        s_wireless = nm_connection_get_setting_wireless (connection);
        if (!s_wireless) {
@@ -414,9 +409,6 @@ ce_page_wifi_security_new (NMConnection *connection,
 
        s_wsec = nm_connection_get_setting_wireless_security (connection);
 
-       security = nm_setting_wireless_get_security (s_wireless);
-       if (!security || strcmp (security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME))
-               s_wsec = NULL;
        if (s_wsec)
                default_type = get_default_type_for_security (s_wsec);
 
@@ -510,7 +502,6 @@ validate (CEPage *page, NMConnection *connection, GError **error)
                wireless_security_unref (sec);
        } else {
                /* No security, unencrypted */
-               g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NULL, NULL);
                nm_connection_remove_setting (connection, NM_TYPE_SETTING_WIRELESS_SECURITY);
                nm_connection_remove_setting (connection, NM_TYPE_SETTING_802_1X);
                valid = TRUE;
diff --git a/src/connection-editor/page-wifi.c b/src/connection-editor/page-wifi.c
index a1ff767..bf6c47d 100644
--- a/src/connection-editor/page-wifi.c
+++ b/src/connection-editor/page-wifi.c
@@ -571,7 +571,6 @@ validate (CEPage *page, NMConnection *connection, GError **error)
 {
        CEPageWifi *self = CE_PAGE_WIFI (page);
        CEPageWifiPrivate *priv = CE_PAGE_WIFI_GET_PRIVATE (self);
-       char *security;
        gboolean success;
        gboolean invalid = FALSE;
        GByteArray *ignore;
@@ -603,13 +602,7 @@ validate (CEPage *page, NMConnection *connection, GError **error)
 
        ui_to_setting (self);
 
-       /* A hack to not check the wifi security here */
-       security = g_strdup (nm_setting_wireless_get_security (priv->setting));
-       g_object_set (priv->setting, NM_SETTING_WIRELESS_SEC, NULL, NULL);
-
        success = nm_setting_verify (NM_SETTING (priv->setting), NULL, error);
-       g_object_set (priv->setting, NM_SETTING_WIRELESS_SEC, security, NULL);
-       g_free (security);
 
        return success;
 }
diff --git a/src/gconf-helpers/gconf-upgrade.c b/src/gconf-helpers/gconf-upgrade.c
index 18e14f5..cacd919 100644
--- a/src/gconf-helpers/gconf-upgrade.c
+++ b/src/gconf-helpers/gconf-upgrade.c
@@ -537,8 +537,6 @@ nm_gconf_read_0_6_wireless_connection (GConfClient *client,
        nm_utils_slist_free (bssids, g_free);
 
        if (we_cipher != NM_AUTH_TYPE_NONE) {
-               g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, 
NULL);
-
                switch (we_cipher) {
                case NM_AUTH_TYPE_WEP40:
                case NM_AUTH_TYPE_WEP104:
diff --git a/src/libnm-gtk/nm-wifi-dialog.c b/src/libnm-gtk/nm-wifi-dialog.c
index 496220c..bcd5cb7 100644
--- a/src/libnm-gtk/nm-wifi-dialog.c
+++ b/src/libnm-gtk/nm-wifi-dialog.c
@@ -842,7 +842,6 @@ security_combo_init (NMAWifiDialog *self, gboolean secrets_only)
 
        if (priv->connection) {
                const char *mode;
-               const char *security;
 
                s_wireless = nm_connection_get_setting_wireless (priv->connection);
 
@@ -852,9 +851,6 @@ security_combo_init (NMAWifiDialog *self, gboolean secrets_only)
 
                wsec = nm_connection_get_setting_wireless_security (priv->connection);
 
-               security = nm_setting_wireless_get_security (s_wireless);
-               if (!security || strcmp (security, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME))
-                       wsec = NULL;
                if (wsec) {
                        default_type = get_default_type_for_security (wsec, !!priv->ap, ap_flags, dev_caps);
                        if (default_type == NMU_SEC_STATIC_WEP)
@@ -1223,12 +1219,6 @@ nma_wifi_dialog_get_connection (NMAWifiDialog *self,
        if (sec) {
                wireless_security_fill_connection (sec, connection);
                wireless_security_unref (sec);
-       } else {
-               /* Unencrypted */
-               s_wireless = nm_connection_get_setting_wireless (connection);
-               g_assert (s_wireless);
-
-               g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NULL, NULL);
        }
 
        /* Fill device */
diff --git a/src/wireless-security/wireless-security.c b/src/wireless-security/wireless-security.c
index f3a6bbf..73315b1 100644
--- a/src/wireless-security/wireless-security.c
+++ b/src/wireless-security/wireless-security.c
@@ -515,18 +515,12 @@ ws_802_1x_fill_connection (WirelessSecurity *sec,
                            NMConnection *connection)
 {
        GtkWidget *widget;
-       NMSettingWireless *s_wireless;
        NMSettingWirelessSecurity *s_wireless_sec;
        NMSetting8021x *s_8021x;
        EAPMethod *eap = NULL;
        GtkTreeModel *model;
        GtkTreeIter iter;
 
-       s_wireless = nm_connection_get_setting_wireless (connection);
-       g_assert (s_wireless);
-
-       g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL);
-
        /* Blow away the old wireless security setting by adding a clear one */
        s_wireless_sec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
        nm_connection_add_setting (connection, (NMSetting *) s_wireless_sec);
diff --git a/src/wireless-security/ws-leap.c b/src/wireless-security/ws-leap.c
index 16327cb..0db9c1a 100644
--- a/src/wireless-security/ws-leap.c
+++ b/src/wireless-security/ws-leap.c
@@ -81,16 +81,10 @@ static void
 fill_connection (WirelessSecurity *parent, NMConnection *connection)
 {
        WirelessSecurityLEAP *sec = (WirelessSecurityLEAP *) parent;
-       NMSettingWireless *s_wireless;
        NMSettingWirelessSecurity *s_wireless_sec;
        GtkWidget *widget;
        const char *leap_password = NULL, *leap_username = NULL;
 
-       s_wireless = nm_connection_get_setting_wireless (connection);
-       g_assert (s_wireless);
-
-       g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL);
-
        /* Blow away the old security setting by adding a clear one */
        s_wireless_sec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
        nm_connection_add_setting (connection, (NMSetting *) s_wireless_sec);
diff --git a/src/wireless-security/ws-wep-key.c b/src/wireless-security/ws-wep-key.c
index 6af08df..17ec002 100644
--- a/src/wireless-security/ws-wep-key.c
+++ b/src/wireless-security/ws-wep-key.c
@@ -142,7 +142,6 @@ static void
 fill_connection (WirelessSecurity *parent, NMConnection *connection)
 {
        WirelessSecurityWEPKey *sec = (WirelessSecurityWEPKey *) parent;
-       NMSettingWireless *s_wireless;
        NMSettingWirelessSecurity *s_wsec;
        GtkWidget *widget;
        gint auth_alg;
@@ -156,11 +155,6 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
        key = gtk_entry_get_text (GTK_ENTRY (widget));
        strcpy (sec->keys[sec->cur_index], key);
 
-       s_wireless = nm_connection_get_setting_wireless (connection);
-       g_assert (s_wireless);
-
-       g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL);
-
        /* Blow away the old security setting by adding a clear one */
        s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
        nm_connection_add_setting (connection, (NMSetting *) s_wsec);
diff --git a/src/wireless-security/ws-wpa-psk.c b/src/wireless-security/ws-wpa-psk.c
index f19b25a..bc27a2f 100644
--- a/src/wireless-security/ws-wpa-psk.c
+++ b/src/wireless-security/ws-wpa-psk.c
@@ -104,8 +104,6 @@ fill_connection (WirelessSecurity *parent, NMConnection *connection)
        if (mode && !strcmp (mode, "adhoc"))
                is_adhoc = TRUE;
 
-       g_object_set (s_wireless, NM_SETTING_WIRELESS_SEC, NM_SETTING_WIRELESS_SECURITY_SETTING_NAME, NULL);
-
        /* Blow away the old security setting by adding a clear one */
        s_wireless_sec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
        nm_connection_add_setting (connection, (NMSetting *) s_wireless_sec);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]