summaryrefslogtreecommitdiff
path: root/src/connection-editor/page-vpn.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/connection-editor/page-vpn.c')
-rw-r--r--src/connection-editor/page-vpn.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/connection-editor/page-vpn.c b/src/connection-editor/page-vpn.c
index 0eab8b62..194cd4c7 100644
--- a/src/connection-editor/page-vpn.c
+++ b/src/connection-editor/page-vpn.c
@@ -256,6 +256,7 @@ vpn_connection_new (FUNC_TAG_PAGE_NEW_CONNECTION_IMPL,
}
connection = _ensure_connection_other (connection, &connection_tmp);
+
if (detail) {
service_type = detail;
add_detail_key = vpn_data ? vpn_data->add_detail_key : NULL;
@@ -300,8 +301,14 @@ vpn_connection_new (FUNC_TAG_PAGE_NEW_CONNECTION_IMPL,
if (!service_type)
service_type = detail;
- s_vpn = nm_setting_vpn_new ();
- g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, service_type, NULL);
+ s_vpn = NM_SETTING (nm_connection_get_setting_vpn (connection));
+ if (!s_vpn)
+ s_vpn = nm_setting_vpn_new ();
+ else
+ g_object_ref (s_vpn);
+
+ if (!nm_setting_vpn_get_service_type (NM_SETTING_VPN(s_vpn)))
+ g_object_set (s_vpn, NM_SETTING_VPN_SERVICE_TYPE, service_type, NULL);
if (add_detail_key)
nm_setting_vpn_add_data_item ((NMSettingVpn *) s_vpn, add_detail_key, add_detail_val);