[gnome-control-center] network: Merge public method that is only used internally once
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] network: Merge public method that is only used internally once
- Date: Wed, 27 Nov 2019 22:10:09 +0000 (UTC)
commit 08b922f09da28698cc24f9332554673deafd4a6e
Author: Robert Ancell <robert ancell canonical com>
Date: Thu Nov 7 13:41:23 2019 +1300
network: Merge public method that is only used internally once
.../network/wireless-security/wireless-security.c | 44 +++++++++-------------
.../network/wireless-security/wireless-security.h | 2 -
2 files changed, 17 insertions(+), 29 deletions(-)
---
diff --git a/panels/network/wireless-security/wireless-security.c
b/panels/network/wireless-security/wireless-security.c
index 5750047fd..6909283a2 100644
--- a/panels/network/wireless-security/wireless-security.c
+++ b/panels/network/wireless-security/wireless-security.c
@@ -319,32 +319,6 @@ wireless_security_set_userpass (WirelessSecurity *self,
priv->show_password = show_password;
}
-void
-wireless_security_set_userpass_802_1x (WirelessSecurity *self,
- NMConnection *connection)
-{
- const char *user = NULL, *password = NULL;
- gboolean always_ask = FALSE, show_password = FALSE;
- NMSetting8021x *setting;
- NMSettingSecretFlags flags;
-
- if (!connection)
- goto set;
-
- setting = nm_connection_get_setting_802_1x (connection);
- if (!setting)
- goto set;
-
- user = nm_setting_802_1x_get_identity (setting);
- password = nm_setting_802_1x_get_password (setting);
-
- if (nm_setting_get_secret_flags (NM_SETTING (setting), NM_SETTING_802_1X_PASSWORD, &flags, NULL))
- always_ask = !!(flags & NM_SETTING_SECRET_FLAG_NOT_SAVED);
-
-set:
- wireless_security_set_userpass (self, user, password, always_ask, show_password);
-}
-
void
wireless_security_clear_ciphers (NMConnection *connection)
{
@@ -416,6 +390,8 @@ ws_802_1x_auth_combo_init (WirelessSecurity *self,
gboolean is_editor,
gboolean secrets_only)
{
+ const gchar *user = NULL, *password = NULL;
+ gboolean always_ask = FALSE;
g_autoptr(GtkListStore) auth_model = NULL;
GtkTreeIter iter;
g_autoptr(EAPMethodTLS) em_tls = NULL;
@@ -446,7 +422,21 @@ ws_802_1x_auth_combo_init (WirelessSecurity *self,
}
/* initialize WirelessSecurity userpass from connection (clear if no connection) */
- wireless_security_set_userpass_802_1x (self, connection);
+ if (connection) {
+ NMSetting8021x *setting;
+
+ setting = nm_connection_get_setting_802_1x (connection);
+ if (setting) {
+ NMSettingSecretFlags flags;
+
+ user = nm_setting_802_1x_get_identity (setting);
+ password = nm_setting_802_1x_get_password (setting);
+
+ if (nm_setting_get_secret_flags (NM_SETTING (setting), NM_SETTING_802_1X_PASSWORD,
&flags, NULL))
+ always_ask = !!(flags & NM_SETTING_SECRET_FLAG_NOT_SAVED);
+ }
+ }
+ wireless_security_set_userpass (self, user, password, always_ask, FALSE);
auth_model = gtk_list_store_new (2, G_TYPE_STRING, eap_method_get_type ());
diff --git a/panels/network/wireless-security/wireless-security.h
b/panels/network/wireless-security/wireless-security.h
index 15424ac2c..ea2d56ba4 100644
--- a/panels/network/wireless-security/wireless-security.h
+++ b/panels/network/wireless-security/wireless-security.h
@@ -83,8 +83,6 @@ void wireless_security_set_userpass (WirelessSecurity *sec,
const char *password,
gboolean always_ask,
gboolean show_password);
-void wireless_security_set_userpass_802_1x (WirelessSecurity *sec,
- NMConnection *connection);
WirelessSecurity *wireless_security_ref (WirelessSecurity *sec);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]