[NetworkManager-vpnc] properties: Don't set interface name as empty string by default



commit f4df2db6ca1c0dfe29ea721c443f38c545721be9
Author: Jonathan Kang <jonathankang gnome org>
Date:   Mon Apr 18 16:00:05 2022 +0800

    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

 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;


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