aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2013-09-11 18:48:18 +0000
committerTarmac <Unknown>2013-09-11 18:48:18 +0000
commitf853cb252ce91219156046105a70698e60d0aed9 (patch)
tree43625044ae598e87832fa50cd001a50d8ef5f306
parent5507ff922d38d898d021b5246e27a720920e6d23 (diff)
parent4ca541cc16b60f29a03694034900c30b4d8a5cbd (diff)
downloadayatana-indicator-power-f853cb252ce91219156046105a70698e60d0aed9.tar.gz
ayatana-indicator-power-f853cb252ce91219156046105a70698e60d0aed9.tar.bz2
ayatana-indicator-power-f853cb252ce91219156046105a70698e60d0aed9.zip
Adds a title in the header's action state. Fixes: https://bugs.launchpad.net/bugs/1223635.
Approved by Ted Gould, PS Jenkins bot.
-rw-r--r--src/service.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/service.c b/src/service.c
index b4f05ea..b5227f6 100644
--- a/src/service.c
+++ b/src/service.c
@@ -332,15 +332,13 @@ create_header_state (IndicatorPowerService * self)
g_variant_builder_init (&b, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add (&b, "{sv}", "title", g_variant_new_string (_("Battery")));
+
g_variant_builder_add (&b, "{sv}", "visible",
g_variant_new_boolean (should_be_visible (self)));
if (label != NULL)
- {
- g_variant_builder_add (&b, "{sv}", "label", g_variant_new_string (label));
-
- g_free (label);
- }
+ g_variant_builder_add (&b, "{sv}", "label", g_variant_new_take_string (label));
if (icon != NULL)
{
@@ -350,12 +348,7 @@ create_header_state (IndicatorPowerService * self)
}
if (a11y != NULL)
- {
- g_variant_builder_add (&b, "{sv}", "accessible-desc",
- g_variant_new_string (a11y));
-
- g_free (a11y);
- }
+ g_variant_builder_add (&b, "{sv}", "accessible-desc", g_variant_new_take_string (a11y));
return g_variant_builder_end (&b);
}