diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2013-09-05 13:25:05 -0500 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2013-09-05 13:25:05 -0500 |
commit | 1272fff388d793a44dc166850e5f1005bb5741b0 (patch) | |
tree | 9cc84f15bd9dd8b3e52c19d32bd2b5b617ebd40b /src | |
parent | 86333cb7f91ef594088ded32927454940745d96d (diff) | |
download | ayatana-indicator-datetime-1272fff388d793a44dc166850e5f1005bb5741b0.tar.gz ayatana-indicator-datetime-1272fff388d793a44dc166850e5f1005bb5741b0.tar.bz2 ayatana-indicator-datetime-1272fff388d793a44dc166850e5f1005bb5741b0.zip |
in service.c, use g_variant_new_take_string() instead of g_variant_new_string() where appropriate
Diffstat (limited to 'src')
-rw-r--r-- | src/service.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/service.c b/src/service.c index c36e996..d7ae22f 100644 --- a/src/service.c +++ b/src/service.c @@ -499,12 +499,11 @@ create_desktop_header_state (IndicatorDatetimeService * self) g_variant_builder_init (&b, G_VARIANT_TYPE("a{sv}")); g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_string (str)); - g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (str)); + g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (str)); g_variant_builder_add (&b, "{sv}", "visible", g_variant_new_boolean (visible)); /* cleanup */ g_date_time_unref (now); - g_free (str); g_free (fmt); return g_variant_builder_end (&b); } @@ -528,7 +527,6 @@ create_phone_header_state (IndicatorDatetimeService * self) now = indicator_datetime_service_get_localtime (self); fmt = get_terse_time_format_string (now); label = g_date_time_format (now, fmt); - g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (label)); /* icon */ if ((has_alarms = service_has_alarms (self))) @@ -545,14 +543,12 @@ create_phone_header_state (IndicatorDatetimeService * self) else a11y = g_strdup (label); g_variant_builder_add (&b, "{sv}", "accessible-desc", - g_variant_new_string (a11y)); + g_variant_new_take_string (a11y)); - /* visible */ g_variant_builder_add (&b, "{sv}", "visible", g_variant_new_boolean (TRUE)); + g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (label)); /* cleanup */ - g_free (a11y); - g_free (label); g_date_time_unref (now); return g_variant_builder_end (&b); } |