From 099b58a8c98c9c26f75af775dcae0680217e5f15 Mon Sep 17 00:00:00 2001 From: Robert Ancell Date: Tue, 3 Dec 2019 15:18:11 +1300 Subject: [PATCH] network: Remove constant password_flags_name property --- panels/network/wireless-security/eap-method-tls.c | 1 - panels/network/wireless-security/ws-leap.c | 10 +++------- panels/network/wireless-security/ws-wep-key.c | 7 ++----- panels/network/wireless-security/ws-wpa-psk.c | 8 ++------ 4 files changed, 7 insertions(+), 19 deletions(-) diff --git a/panels/network/wireless-security/eap-method-tls.c b/panels/network/wireless-security/eap-method-tls.c index 030f19053..ce7ff13a5 100644 --- a/panels/network/wireless-security/eap-method-tls.c +++ b/panels/network/wireless-security/eap-method-tls.c @@ -44,7 +44,6 @@ struct _EAPMethodTLS { GtkFileChooserButton *user_cert_button; GtkLabel *user_cert_label; - const gchar *password_flags_name; gchar *username; gchar *password; gboolean show_password; diff --git a/panels/network/wireless-security/ws-leap.c b/panels/network/wireless-security/ws-leap.c index d641237e4..a3391ec5e 100644 --- a/panels/network/wireless-security/ws-leap.c +++ b/panels/network/wireless-security/ws-leap.c @@ -36,8 +36,6 @@ struct _WirelessSecurityLEAP { GtkCheckButton *show_password_check; GtkEntry *username_entry; GtkLabel *username_label; - - const char *password_flags_name; }; static void wireless_security_iface_init (WirelessSecurityInterface *); @@ -114,12 +112,12 @@ fill_connection (WirelessSecurity *security, NMConnection *connection) /* Save LEAP_PASSWORD_FLAGS to the connection */ secret_flags = nma_utils_menu_to_secret_flags (GTK_WIDGET (self->password_entry)); - nm_setting_set_secret_flags (NM_SETTING (s_wireless_sec), self->password_flags_name, + nm_setting_set_secret_flags (NM_SETTING (s_wireless_sec), NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, secret_flags, NULL); /* Update secret flags and popup when editing the connection */ nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags, - NM_SETTING (s_wireless_sec), self->password_flags_name); + NM_SETTING (s_wireless_sec), NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD); } static gboolean @@ -183,12 +181,10 @@ ws_leap_new (NMConnection *connection) } } - self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD; - g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self); /* Create password-storage popup menu for password entry under entry's secondary icon */ - nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, (NMSetting *) wsec, self->password_flags_name, + nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, (NMSetting *) wsec, NM_SETTING_WIRELESS_SECURITY_LEAP_PASSWORD, FALSE, FALSE); if (wsec) diff --git a/panels/network/wireless-security/ws-wep-key.c b/panels/network/wireless-security/ws-wep-key.c index 6b3b7b44c..ba09a689d 100644 --- a/panels/network/wireless-security/ws-wep-key.c +++ b/panels/network/wireless-security/ws-wep-key.c @@ -39,8 +39,6 @@ struct _WirelessSecurityWEPKey { GtkLabel *key_label; GtkCheckButton *show_key_check; - const char *password_flags_name; - NMWepKeyType type; char keys[4][65]; guint8 cur_index; @@ -193,7 +191,7 @@ fill_connection (WirelessSecurity *security, NMConnection *connection) /* Update secret flags and popup when editing the connection */ nma_utils_update_password_storage (GTK_WIDGET (self->key_entry), secret_flags, - NM_SETTING (s_wsec), self->password_flags_name); + NM_SETTING (s_wsec), NM_SETTING_WIRELESS_SECURITY_WEP_KEY0); } static void @@ -291,7 +289,6 @@ ws_wep_key_new (NMConnection *connection, self = g_object_new (ws_wep_key_get_type (), NULL); - self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_WEP_KEY0; self->type = type; gtk_entry_set_width_chars (self->key_entry, 28); @@ -299,7 +296,7 @@ ws_wep_key_new (NMConnection *connection, /* Create password-storage popup menu for password entry under entry's secondary icon */ if (connection) setting = (NMSetting *) nm_connection_get_setting_wireless_security (connection); - nma_utils_setup_password_storage (GTK_WIDGET (self->key_entry), 0, setting, self->password_flags_name, + nma_utils_setup_password_storage (GTK_WIDGET (self->key_entry), 0, setting, NM_SETTING_WIRELESS_SECURITY_WEP_KEY0, FALSE, FALSE); if (connection) { diff --git a/panels/network/wireless-security/ws-wpa-psk.c b/panels/network/wireless-security/ws-wpa-psk.c index 93a2f260f..653b5ffc7 100644 --- a/panels/network/wireless-security/ws-wpa-psk.c +++ b/panels/network/wireless-security/ws-wpa-psk.c @@ -39,8 +39,6 @@ struct _WirelessSecurityWPAPSK { GtkCheckButton *show_password_check; GtkComboBox *type_combo; GtkLabel *type_label; - - const char *password_flags_name; }; static void wireless_security_iface_init (WirelessSecurityInterface *); @@ -130,7 +128,7 @@ fill_connection (WirelessSecurity *security, NMConnection *connection) /* Update secret flags and popup when editing the connection */ nma_utils_update_password_storage (GTK_WIDGET (self->password_entry), secret_flags, - NM_SETTING (s_wireless_sec), self->password_flags_name); + NM_SETTING (s_wireless_sec), NM_SETTING_WIRELESS_SECURITY_PSK); wireless_security_clear_ciphers (connection); if (is_adhoc) { @@ -201,15 +199,13 @@ ws_wpa_psk_new (NMConnection *connection) self = g_object_new (ws_wpa_psk_get_type (), NULL); - self->password_flags_name = NM_SETTING_WIRELESS_SECURITY_PSK; - g_signal_connect_swapped (self->password_entry, "changed", G_CALLBACK (changed_cb), self); gtk_entry_set_width_chars (self->password_entry, 28); /* Create password-storage popup menu for password entry under entry's secondary icon */ if (connection) setting = (NMSetting *) nm_connection_get_setting_wireless_security (connection); - nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, setting, self->password_flags_name, + nma_utils_setup_password_storage (GTK_WIDGET (self->password_entry), 0, setting, NM_SETTING_WIRELESS_SECURITY_PSK, FALSE, FALSE); /* Fill secrets, if any */