1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
|
From: Jonathan Kang <jonathankang@gnome.org>
Date: Mon, 18 Apr 2022 16:00:05 +0800
Subject: properties: Don't set interface name as empty string by default
Currently, the editor requires users to set an interface name manually.
While this wasn't required before commit 02a23dfa. Fix this by leaving
interface name unset as what it used to be.
https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/-/issues/8
https://gitlab.gnome.org/GNOME/NetworkManager-vpnc/-/merge_requests/9
(cherry picked from commit f4df2db6ca1c0dfe29ea721c443f38c545721be9)
---
properties/nm-vpnc-editor.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/properties/nm-vpnc-editor.c b/properties/nm-vpnc-editor.c
index b7d3ca3..b5236c0 100644
--- a/properties/nm-vpnc-editor.c
+++ b/properties/nm-vpnc-editor.c
@@ -288,8 +288,6 @@ populate_adv_dialog (VpncEditor *self)
g_return_if_fail (widget != NULL);
if (priv->interface_name)
gtk_editable_set_text (GTK_EDITABLE (widget), priv->interface_name);
- else
- gtk_editable_set_text (GTK_EDITABLE (widget), "");
/* Encryption combo */
widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "encryption_combo"));
@@ -900,9 +898,8 @@ update_connection (NMVpnEditor *editor,
update_adv_settings (self, s_vpn);
str = priv->interface_name;
- if (!str)
- str = "";
- g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_INTERFACE_NAME, str, NULL);
+ if (str && strlen (str))
+ g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_INTERFACE_NAME, str, NULL);
nm_connection_add_setting (connection, NM_SETTING (s_vpn));
return TRUE;
|