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



Author: dcbw
Date: Wed Sep 24 09:51:46 2008
New Revision: 900
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=900&view=rev

Log:
2008-09-15  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)



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

Modified: trunk/src/gconf-helpers/gconf-helpers.c
==============================================================================
--- trunk/src/gconf-helpers/gconf-helpers.c	(original)
+++ trunk/src/gconf-helpers/gconf-helpers.c	Wed Sep 24 09:51:46 2008
@@ -453,9 +453,11 @@
 		} 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);
@@ -770,10 +772,14 @@
 	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);
 }



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