aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-07-12 20:42:55 -0500
committerTed Gould <ted@gould.cx>2010-07-12 20:42:55 -0500
commit5c0172d8d390f7f5ff1d8475ef7aea40106f58ea (patch)
treef54758c0b99a1c9d050cf31fa5836d441e461295 /src
parent72de11ccac28b0bad7485a5501bc87329560f39b (diff)
downloadayatana-indicator-datetime-5c0172d8d390f7f5ff1d8475ef7aea40106f58ea.tar.gz
ayatana-indicator-datetime-5c0172d8d390f7f5ff1d8475ef7aea40106f58ea.tar.bz2
ayatana-indicator-datetime-5c0172d8d390f7f5ff1d8475ef7aea40106f58ea.zip
Moving the default format into a define and using our new variable.
Diffstat (limited to 'src')
-rw-r--r--src/indicator-datetime.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/indicator-datetime.c b/src/indicator-datetime.c
index 847cb8e..854bf4d 100644
--- a/src/indicator-datetime.c
+++ b/src/indicator-datetime.c
@@ -83,6 +83,8 @@ enum {
#define SETTING_TIME_FORMAT_S "indicator-time-format"
+#define DEFAULT_TIME_FORMAT "%l:%M %p"
+
#define INDICATOR_DATETIME_GET_PRIVATE(o) \
(G_TYPE_INSTANCE_GET_PRIVATE ((o), INDICATOR_DATETIME_TYPE, IndicatorDatetimePrivate))
@@ -131,7 +133,7 @@ indicator_datetime_class_init (IndicatorDatetimeClass *klass)
g_param_spec_string(PROP_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.",
- "%l:%M %p",
+ DEFAULT_TIME_FORMAT,
G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
return;
@@ -148,7 +150,7 @@ indicator_datetime_init (IndicatorDatetime *self)
self->priv->idle_measure = 0;
self->priv->max_width = 0;
- self->priv->time_format = NULL;
+ self->priv->time_format = g_strdup(DEFAULT_TIME_FORMAT);
self->priv->sm = NULL;
self->priv->menu = NULL;
@@ -276,7 +278,7 @@ update_label (IndicatorDatetime * io)
return;
}
- strftime(longstr, 128, "%l:%M %p", ltime);
+ strftime(longstr, 128, self->priv->time_format, ltime);
gchar * utf8 = g_locale_to_utf8(longstr, -1, NULL, NULL, NULL);
gtk_label_set_label(self->priv->label, utf8);