aboutsummaryrefslogtreecommitdiff
path: root/src/service.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-09-07 07:43:29 -0500
committerCharles Kerr <charles.kerr@canonical.com>2013-09-07 07:43:29 -0500
commitee8cd80522b4a40609974716df6dd5ae8d737e2c (patch)
tree24981febbff8063c87dd3628a3f84243dded7b5b /src/service.c
parent1e5db71bcfbc88fd45c4d3af3e477a1829d99509 (diff)
parent1272fff388d793a44dc166850e5f1005bb5741b0 (diff)
downloadayatana-indicator-datetime-ee8cd80522b4a40609974716df6dd5ae8d737e2c.tar.gz
ayatana-indicator-datetime-ee8cd80522b4a40609974716df6dd5ae8d737e2c.tar.bz2
ayatana-indicator-datetime-ee8cd80522b4a40609974716df6dd5ae8d737e2c.zip
in service.c, use g_variant_new_take_string() instead of g_variant_new_string() where appropriate
Diffstat (limited to 'src/service.c')
-rw-r--r--src/service.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/src/service.c b/src/service.c
index c46beeb..2e7b30c 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);
}