diff options
| author | Michael Biebl <biebl@debian.org> | 2017-12-12 15:53:07 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-12-12 15:53:07 +0100 |
| commit | afcd268ea7b1149fbfb66bce4eca659b675da0a2 (patch) | |
| tree | c3fca2203ad17434daf3ccf576582bd66aa41ab2 /clients/tui | |
| parent | 417f6015c3dc8c47cf27daa59f64e0e36c521b9c (diff) | |
New upstream version 1.10.2 upstream/1.10.2
Diffstat (limited to 'clients/tui')
| -rw-r--r-- | clients/tui/newt/nmt-newt-utils.c | 2 | ||||
| -rw-r--r-- | clients/tui/nm-editor-bindings.c | 3 | ||||
| -rw-r--r-- | clients/tui/nmt-page-wifi.c | 30 |
3 files changed, 29 insertions, 6 deletions
diff --git a/clients/tui/newt/nmt-newt-utils.c b/clients/tui/newt/nmt-newt-utils.c index a8541829..f37a851e 100644 --- a/clients/tui/newt/nmt-newt-utils.c +++ b/clients/tui/newt/nmt-newt-utils.c @@ -336,7 +336,7 @@ nmt_newt_edit_string (const char *data) len -= nwrote; data += nwrote; } - close (fd); + nm_close (fd); argv[0] = (char *) g_getenv ("VISUAL"); if (!argv[0]) diff --git a/clients/tui/nm-editor-bindings.c b/clients/tui/nm-editor-bindings.c index 647ac8df..24803868 100644 --- a/clients/tui/nm-editor-bindings.c +++ b/clients/tui/nm-editor-bindings.c @@ -585,9 +585,6 @@ get_security_type (NMEditorWirelessSecurityMethodBinding *binding) return "none"; key_mgmt = nm_setting_wireless_security_get_key_mgmt (binding->s_wsec); - if (!key_mgmt) - return "none"; - auth_alg = nm_setting_wireless_security_get_auth_alg (binding->s_wsec); /* No IEEE 802.1x */ diff --git a/clients/tui/nmt-page-wifi.c b/clients/tui/nmt-page-wifi.c index f846345c..35625fe4 100644 --- a/clients/tui/nmt-page-wifi.c +++ b/clients/tui/nmt-page-wifi.c @@ -38,6 +38,13 @@ G_DEFINE_TYPE (NmtPageWifi, nmt_page_wifi, NMT_TYPE_EDITOR_PAGE_DEVICE) +#define NMT_PAGE_WIFI_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NMT_TYPE_PAGE_WIFI, NmtPageWifiPrivate)) + +typedef struct { + NMSettingWirelessSecurity *s_wsec; + +} NmtPageWifiPrivate; + NmtEditorPage * nmt_page_wifi_new (NMConnection *conn, NmtDeviceEntry *deventry) @@ -170,6 +177,7 @@ ssid_transform_from_entry (GBinding *binding, static void nmt_page_wifi_constructed (GObject *object) { + NmtPageWifiPrivate *priv = NMT_PAGE_WIFI_GET_PRIVATE (object); NmtPageWifi *wifi = NMT_PAGE_WIFI (object); NmtDeviceEntry *deventry; NmtEditorSection *section; @@ -190,9 +198,13 @@ nmt_page_wifi_constructed (GObject *object) s_wsec = nm_connection_get_setting_wireless_security (conn); if (!s_wsec) { - nm_connection_add_setting (conn, nm_setting_wireless_security_new ()); - s_wsec = nm_connection_get_setting_wireless_security (conn); + /* It makes things simpler if we always have a + * NMSettingWirelessSecurity; we'll hold a ref on one, and add + * it to and remove it from the connection as needed. + */ + s_wsec = NM_SETTING_WIRELESS_SECURITY (nm_setting_wireless_security_new ()); } + priv->s_wsec = g_object_ref_sink (s_wsec); deventry = nmt_editor_page_device_get_device_entry (NMT_EDITOR_PAGE_DEVICE (object)); g_object_bind_property (s_wireless, NM_SETTING_WIRELESS_MAC_ADDRESS, @@ -363,9 +375,23 @@ nmt_page_wifi_constructed (GObject *object) } static void +nmt_page_wifi_finalize (GObject *object) +{ + NmtPageWifiPrivate *priv = NMT_PAGE_WIFI_GET_PRIVATE (object); + + g_clear_object (&priv->s_wsec); + + G_OBJECT_CLASS (nmt_page_wifi_parent_class)->finalize (object); +} + + +static void nmt_page_wifi_class_init (NmtPageWifiClass *wifi_class) { GObjectClass *object_class = G_OBJECT_CLASS (wifi_class); + g_type_class_add_private (wifi_class, sizeof (NmtPageWifiPrivate)); + object_class->constructed = nmt_page_wifi_constructed; + object_class->finalize = nmt_page_wifi_finalize; } |