aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-10-17 23:08:48 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-10-17 23:08:48 -0500
commit7fe0540b750cf88062427e8a1536f67bd2c5d8d3 (patch)
treedfe154e9e8962f62ea5c7a741fd77eccf47edb54 /src
parent0df37b0d0a4ae9ae14d896965fa37a9e61d0f7ab (diff)
downloadayatana-indicator-datetime-7fe0540b750cf88062427e8a1536f67bd2c5d8d3.tar.gz
ayatana-indicator-datetime-7fe0540b750cf88062427e8a1536f67bd2c5d8d3.tar.bz2
ayatana-indicator-datetime-7fe0540b750cf88062427e8a1536f67bd2c5d8d3.zip
when building the desktop header state, reuse the label variant
Diffstat (limited to 'src')
-rw-r--r--src/service.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/service.c b/src/service.c
index b6e9fe8..4eb1542 100644
--- a/src/service.c
+++ b/src/service.c
@@ -679,6 +679,7 @@ create_desktop_header_state (IndicatorDatetimeService * self)
gboolean visible;
GDateTime * now;
const gchar * title = _("Date and Time");
+ GVariant * label_variant;
visible = g_settings_get_boolean (self->priv->settings, SETTINGS_SHOW_CLOCK_S);
@@ -692,9 +693,10 @@ create_desktop_header_state (IndicatorDatetimeService * self)
g_warning ("%s", str);
}
+ label_variant = g_variant_new_take_string (str);
g_variant_builder_init (&b, G_VARIANT_TYPE_VARDICT);
- g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_string (str));
- g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (str));
+ g_variant_builder_add (&b, "{sv}", "accessible-desc", label_variant);
+ g_variant_builder_add (&b, "{sv}", "label", label_variant);
g_variant_builder_add (&b, "{sv}", "title", g_variant_new_string (title));
g_variant_builder_add (&b, "{sv}", "visible", g_variant_new_boolean (visible));
@@ -1193,6 +1195,7 @@ create_locations_section (IndicatorDatetimeService * self)
const char * tz = detected_timezones[i];
gchar * name = get_current_zone_name (tz, p->settings);
locations = locations_add (locations, tz, name, TRUE);
+ g_free (name);
}
/* maybe add the user-specified locations */