← Back to team overview

ayatana-commits team mailing list archive

[Merge] lp:~jjardon/indicator-datetime/fix-775113 into lp:indicator-datetime

 

Javier Jardón has proposed merging lp:~jjardon/indicator-datetime/fix-775113 into lp:indicator-datetime.

Requested reviews:
  Indicator Applet Developers (indicator-applet-developers)
Related bugs:
  Bug #775113 in Indicator Date and Time: "Custom time format in datetime applet cannot handle some format specifiers"
  https://bugs.launchpad.net/indicator-datetime/+bug/775113

For more details, see:
https://code.launchpad.net/~jjardon/indicator-datetime/fix-775113/+merge/73846
-- 
https://code.launchpad.net/~jjardon/indicator-datetime/fix-775113/+merge/73846
Your team ayatana-commits is subscribed to branch lp:indicator-datetime.
=== modified file 'src/indicator-datetime.c'
--- src/indicator-datetime.c	2011-08-25 14:46:51 +0000
+++ src/indicator-datetime.c	2011-09-02 15:46:39 +0000
@@ -215,7 +215,7 @@
 	                                 PROP_TIME_FORMAT,
 	                                 g_param_spec_int(PROP_TIME_FORMAT_S,
 	                                                  "A choice of which format should be used on the panel",
-	                                                  "Chooses between letting the locale choose the time, 12-hour time, 24-time or using the custom string passed to strftime().",
+	                                                  "Chooses between letting the locale choose the time, 12-hour time, 24-time or using the custom string passed to g_date_time_format().",
 	                                                  SETTINGS_TIME_LOCALE, /* min */
 	                                                  SETTINGS_TIME_CUSTOM, /* max */
 	                                                  SETTINGS_TIME_LOCALE, /* default */
@@ -245,7 +245,7 @@
 	                                 PROP_CUSTOM_TIME_FORMAT,
 	                                 g_param_spec_string(PROP_CUSTOM_TIME_FORMAT_S,
 	                                                     "The format that is used to show the time on the panel.",
-	                                                     "A format string in the form used to pass to strftime to make a string for displaying on the panel.",
+	                                                     "A format string in the form used to pass to g_date_time_format() to make a string for displaying on the panel.",
 	                                                     DEFAULT_TIME_FORMAT,
 	                                                     G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
 
@@ -775,6 +775,12 @@
 	}
 	else {
 		timestr = g_date_time_format(datetime_now, format);
+		if (timestr == NULL) {
+			g_warning ("The custom date format is not valid, check the
+			            g_date_time_format() documentation for the supported
+			            format specifiers ");
+			timestr = g_strdup ("Date format not supported");
+		}
 	}
 
 	gboolean use_markup = FALSE;


Follow ups