aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-06 23:03:06 -0600
committerTed Gould <ted@gould.cx>2011-01-06 23:03:06 -0600
commit9402dbecd6db1b004a0cb5e894260106b1a5f537 (patch)
tree24f62a1960666c52d5fe3753faa25354b71a0908
parentedecf345e2db43483e33cd416b9242c29f45038a (diff)
downloadayatana-indicator-datetime-9402dbecd6db1b004a0cb5e894260106b1a5f537.tar.gz
ayatana-indicator-datetime-9402dbecd6db1b004a0cb5e894260106b1a5f537.tar.bz2
ayatana-indicator-datetime-9402dbecd6db1b004a0cb5e894260106b1a5f537.zip
A couple of slight cleanups
-rw-r--r--src/indicator-datetime.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 83e32d0..718bebc 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -878,23 +878,29 @@ T_(const char *msg)
/* Put everything back the way it was */
setlocale(LC_MESSAGES, message_locale);
- g_setenv("LANGUAGE", language, 1);
+ g_setenv("LANGUAGE", language, TRUE);
g_free(message_locale);
g_free(time_locale);
g_free(language);
return rv;
}
+/* Check the system locale setting to see if the format is 24-hour
+ time or 12-hour time */
static gboolean
is_locale_12h()
{
static const char *formats_24h[] = {"%H", "%R", "%T", "%OH", "%k", NULL};
- const char *t_fmt = nl_langinfo(T_FMT);
- int i;
- for (i = 0; formats_24h[i]; ++i)
- if (strstr(t_fmt, formats_24h[i]))
- return FALSE;
- return TRUE;
+ const char *t_fmt = nl_langinfo(T_FMT);
+ int i;
+
+ for (i = 0; formats_24h[i]; ++i) {
+ if (strstr(t_fmt, formats_24h[i])) {
+ return FALSE;
+ }
+ }
+
+ return TRUE;
}
/* Tries to figure out what our format string should be. Lots