network-manager-applet r841 - in trunk: . src/gconf-helpers



Author: dcbw
Date: Tue Aug 12 17:45:37 2008
New Revision: 841
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=841&view=rev

Log:
2008-08-12  Dan Williams  <dcbw redhat com>

	* src/gconf-helpers/gconf-upgrade.c
		- (nm_gconf_migrate_0_7_openvpn_properties): migrate 'shared' -> 'static'
			too, fix missing initialization that caused connection type not to
			get migrated



Modified:
   trunk/ChangeLog
   trunk/src/gconf-helpers/gconf-upgrade.c

Modified: trunk/src/gconf-helpers/gconf-upgrade.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-upgrade.c	(original)
+++ trunk/src/gconf-helpers/gconf-upgrade.c	Tue Aug 12 17:45:37 2008
@@ -1384,6 +1384,38 @@
 	g_free (del_key);
 }
 
+static void
+move_one_vpn_string_string (GConfClient *client,
+                            const char *path,
+                            const char *old_key,
+                            const char *new_key)
+{
+	char *del_key;
+	char *value = NULL;
+
+	if (!nm_gconf_get_string_helper (client, path,
+	                                 old_key,
+	                                 NM_SETTING_VPN_SETTING_NAME,
+	                                 &value));
+		return;
+
+	if (value && strlen (value)) {
+		nm_gconf_set_string_helper (client, path,
+		                            new_key,
+		                            NM_SETTING_VPN_SETTING_NAME,
+		                            value);
+	}
+	g_free (value);
+
+	/* delete old key */
+	del_key = g_strdup_printf ("%s/%s/%s",
+	                           path,
+	                           NM_SETTING_VPN_SETTING_NAME,
+	                           old_key);
+	gconf_client_unset (client, del_key, NULL);
+	g_free (del_key);
+}
+
 void
 nm_gconf_migrate_0_7_openvpn_properties (GConfClient *client)
 {
@@ -1391,7 +1423,7 @@
 
 	connections = gconf_client_all_dirs (client, GCONF_PATH_CONNECTIONS, NULL);
 	for (iter = connections; iter; iter = iter->next) {
-		char *old_type, *new_type = NULL, *service = NULL;
+		char *old_type = NULL, *new_type = NULL, *service = NULL;
 
 		if (!nm_gconf_get_string_helper (client, (const char *) iter->data,
 		                                 NM_SETTING_VPN_SERVICE_TYPE,
@@ -1404,6 +1436,8 @@
 
 		move_one_vpn_string_bool (client, iter->data, "dev", "tap-dev");
 		move_one_vpn_string_bool (client, iter->data, "proto", "proto-tcp");
+		move_one_vpn_string_string (client, iter->data, "shared-key", "static-key");
+		move_one_vpn_string_string (client, iter->data, "shared-key-direction", "static-key-direction");
 
 		if (!nm_gconf_get_string_helper (client, (const char *) iter->data,
 		                                 "connection-type",



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