From 7fe0540b750cf88062427e8a1536f67bd2c5d8d3 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 17 Oct 2013 23:08:48 -0500 Subject: when building the desktop header state, reuse the label variant --- src/service.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') 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 */ -- cgit v1.2.3