gnome-control-center r8574 - trunk/capplets/common



Author: jensg
Date: Tue Mar 11 17:33:31 2008
New Revision: 8574
URL: http://svn.gnome.org/viewvc/gnome-control-center?rev=8574&view=rev

Log:
2008-03-11  Jens Granseuer  <jensgr gmx net>

	* gconf-property-editor.c: (peditor_numeric_range_widget_changed): don't
	free the GConf value if we don't have one. Fixes a crash when schemas
	are not properly installed (bug #520744)


Modified:
   trunk/capplets/common/ChangeLog
   trunk/capplets/common/gconf-property-editor.c

Modified: trunk/capplets/common/gconf-property-editor.c
==============================================================================
--- trunk/capplets/common/gconf-property-editor.c	(original)
+++ trunk/capplets/common/gconf-property-editor.c	Tue Mar 11 17:33:31 2008
@@ -1122,7 +1122,7 @@
 	if (!peditor->p->inited) return;
 
 	/* We try to get the default type from the schemas.  if not, we default
-	 * to a float.
+	 * to an int.
 	 */
 	client = gconf_client_get_default();
 
@@ -1131,9 +1131,10 @@
 							      NULL);
 	g_object_unref (client);
 
-	if (default_value)
+	if (default_value) {
 		value_wid = gconf_value_new (default_value->type);
-	else {
+		gconf_value_free (default_value);
+	} else {
 		g_warning ("Unable to find a default value for key for %s.\n"
 			   "I'll assume it is an integer, but that may break things.\n"
 			   "Please be sure that the associated schema is installed",
@@ -1141,8 +1142,6 @@
 		value_wid = gconf_value_new (GCONF_VALUE_INT);
 	}
 
-	gconf_value_free (default_value);
-
 	g_assert (value_wid);
 
 	if (value_wid->type == GCONF_VALUE_INT)
@@ -1150,7 +1149,7 @@
 	else if (value_wid->type == GCONF_VALUE_FLOAT)
 		gconf_value_set_float (value_wid, gtk_adjustment_get_value (adjustment));
 	else {
-		g_warning ("unable to set a gconf key for %s of type %d\n",
+		g_warning ("unable to set a gconf key for %s of type %d",
 			   peditor->p->key,
 			   value_wid->type);
 		gconf_value_free (value_wid);



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