aboutsummaryrefslogtreecommitdiff
path: root/src/formatter.cpp
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2014-01-27 01:25:07 -0600
committerCharles Kerr <charles.kerr@canonical.com>2014-01-27 01:25:07 -0600
commita268daf59f5b3a8ccd99f2b821a4c7cbcca3ccbc (patch)
tree06f73909e6ff7d804afd0c3d9c50691e1db8ce6e /src/formatter.cpp
parentc1ffb9cd6082acb7aa7e820a7ed852adc7ae648d (diff)
downloadayatana-indicator-datetime-a268daf59f5b3a8ccd99f2b821a4c7cbcca3ccbc.tar.gz
ayatana-indicator-datetime-a268daf59f5b3a8ccd99f2b821a4c7cbcca3ccbc.tar.bz2
ayatana-indicator-datetime-a268daf59f5b3a8ccd99f2b821a4c7cbcca3ccbc.zip
remove code duplication between formatter.cpp and utils.cpp
Diffstat (limited to 'src/formatter.cpp')
-rw-r--r--src/formatter.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/formatter.cpp b/src/formatter.cpp
index a271ba0..989781a 100644
--- a/src/formatter.cpp
+++ b/src/formatter.cpp
@@ -20,6 +20,7 @@
#include <datetime/formatter.h>
#include <datetime/clock.h>
+#include <datetime/utils.h>
#include <glib.h>
#include <glib/gi18n.h>
@@ -226,14 +227,7 @@ Formatter::~Formatter()
bool
Formatter::is_locale_12h()
{
- static const char *formats_24h[] = {"%H", "%R", "%T", "%OH", "%k"};
- const auto t_fmt = nl_langinfo(T_FMT);
-
- for (const auto& needle : formats_24h)
- if (strstr(t_fmt, needle))
- return false;
-
- return true;
+ return ::is_locale_12h();
}
const char*