89 lines
3.9 KiB
Diff
89 lines
3.9 KiB
Diff
|
2008-09-24 Dan Williams <dcbw@redhat.com>
|
||
|
|
||
|
* src/gconf-helpers/gconf-upgrade.c
|
||
|
- (nm_gconf_migrate_0_7_vpn_properties): don't set empty values in GConf
|
||
|
- (move_one_vpn_string_bool, move_one_vpn_string_string): fix stray
|
||
|
semicolon that caused values to not get converted and removed
|
||
|
(second part of fix for bgo #553465)
|
||
|
|
||
|
2008-09-24 Dan Williams <dcbw@redhat.com>
|
||
|
|
||
|
* src/gconf-helpers/gconf-helpers.c
|
||
|
- (nm_gconf_get_stringhash_helper, write_properties_stringhash): do not
|
||
|
read or write empty values (partial fix for bgo #553465)
|
||
|
|
||
|
|
||
|
diff -up NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-helpers.c.vpn-fixes NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-helpers.c
|
||
|
--- NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-helpers.c.vpn-fixes 2008-08-22 00:04:31.000000000 -0400
|
||
|
+++ NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-helpers.c 2008-09-30 16:36:47.000000000 -0400
|
||
|
@@ -447,9 +447,11 @@ nm_gconf_get_stringhash_helper (GConfCli
|
||
|
} else {
|
||
|
GConfValue *gc_val = gconf_entry_get_value (entry);
|
||
|
|
||
|
- if (gc_val && gconf_value_get_string (gc_val)) {
|
||
|
- g_hash_table_insert (*value, gconf_unescape_key (gc_key, -1),
|
||
|
- g_strdup (gconf_value_get_string (gc_val)));
|
||
|
+ if (gc_val) {
|
||
|
+ const char *gc_str = gconf_value_get_string (gc_val);
|
||
|
+
|
||
|
+ if (gc_str && strlen (gc_str))
|
||
|
+ g_hash_table_insert (*value, gconf_unescape_key (gc_key, -1), g_strdup (gc_str));
|
||
|
}
|
||
|
}
|
||
|
gconf_entry_free (entry);
|
||
|
@@ -764,10 +766,14 @@ write_properties_stringhash (gpointer ke
|
||
|
WritePropertiesInfo *info = (WritePropertiesInfo *) user_data;
|
||
|
char *esc_key;
|
||
|
char *full_key;
|
||
|
+ const char *str_value = (const char *) value;
|
||
|
+
|
||
|
+ if (!str_value || !strlen (str_value))
|
||
|
+ return;
|
||
|
|
||
|
esc_key = gconf_escape_key ((char *) key, -1);
|
||
|
full_key = g_strconcat (info->path, "/", esc_key, NULL);
|
||
|
- gconf_client_set_string (info->client, full_key, (char *) value, NULL);
|
||
|
+ gconf_client_set_string (info->client, full_key, (char *) str_value, NULL);
|
||
|
g_free (esc_key);
|
||
|
g_free (full_key);
|
||
|
}
|
||
|
diff -up NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-upgrade.c.vpn-fixes NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-upgrade.c
|
||
|
--- NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-upgrade.c.vpn-fixes 2008-08-25 23:05:16.000000000 -0400
|
||
|
+++ NetworkManager-0.7.0/nm-applet-0.7.0/src/gconf-helpers/gconf-upgrade.c 2008-09-30 16:36:47.000000000 -0400
|
||
|
@@ -1197,10 +1197,13 @@ nm_gconf_migrate_0_7_vpn_properties (GCo
|
||
|
|
||
|
switch (entry->value->type) {
|
||
|
case GCONF_VALUE_STRING:
|
||
|
- nm_gconf_set_string_helper (client, (const char *) iter->data,
|
||
|
- key_name,
|
||
|
- NM_SETTING_VPN_SETTING_NAME,
|
||
|
- gconf_value_get_string (entry->value));
|
||
|
+ tmp = (char *) gconf_value_get_string (entry->value);
|
||
|
+ if (tmp && strlen (tmp)) {
|
||
|
+ nm_gconf_set_string_helper (client, (const char *) iter->data,
|
||
|
+ key_name,
|
||
|
+ NM_SETTING_VPN_SETTING_NAME,
|
||
|
+ gconf_value_get_string (entry->value));
|
||
|
+ }
|
||
|
break;
|
||
|
case GCONF_VALUE_INT:
|
||
|
tmp = g_strdup_printf ("%d", gconf_value_get_int (entry->value));
|
||
|
@@ -1247,7 +1250,7 @@ move_one_vpn_string_bool (GConfClient *c
|
||
|
if (!nm_gconf_get_string_helper (client, path,
|
||
|
old_key,
|
||
|
NM_SETTING_VPN_SETTING_NAME,
|
||
|
- &value));
|
||
|
+ &value))
|
||
|
return;
|
||
|
|
||
|
if (value && !strcmp (value, "yes")) {
|
||
|
@@ -1279,7 +1282,7 @@ move_one_vpn_string_string (GConfClient
|
||
|
if (!nm_gconf_get_string_helper (client, path,
|
||
|
old_key,
|
||
|
NM_SETTING_VPN_SETTING_NAME,
|
||
|
- &value));
|
||
|
+ &value))
|
||
|
return;
|
||
|
|
||
|
if (value && strlen (value)) {
|