gnome-panel r10905 - trunk/applets/clock



Author: vuntz
Date: Thu Feb 28 10:49:14 2008
New Revision: 10905
URL: http://svn.gnome.org/viewvc/gnome-panel?rev=10905&view=rev

Log:
2008-02-28  Vincent Untz  <vuntz gnome org>

	* clock.c: (clock_migrate_to_26): don't set the format key if we're
	reaching this without really migrating from 2.6 but because the value
	is just non-sense. Fix a crash, bug #518963.


Modified:
   trunk/applets/clock/ChangeLog
   trunk/applets/clock/clock.c

Modified: trunk/applets/clock/clock.c
==============================================================================
--- trunk/applets/clock/clock.c	(original)
+++ trunk/applets/clock/clock.c	Thu Feb 28 10:49:14 2008
@@ -2266,11 +2266,15 @@
 	else if (hourformat == 24)
 		clock->format = CLOCK_FORMAT_24;
 
-	panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
-				       KEY_FORMAT,
-				       gconf_enum_to_string (format_type_enum_map,
-							     clock->format),
-				       NULL);
+	/* It's still possible that we have none of the old keys, in which case
+	 * we're not migrating from 2.6, but the config is simply wrong. So
+	 * don't set the format key in this case. */
+	if (cd->format != CLOCK_FORMAT_INVALID)
+		panel_applet_gconf_set_string (PANEL_APPLET (clock->applet),
+					       KEY_FORMAT,
+					       gconf_enum_to_string (format_type_enum_map,
+								     clock->format),
+					       NULL);
 }
 
 static void



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