aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-power.c
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-04-15 09:23:24 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-04-15 09:23:24 -0500
commit820cc22b429e6b89f107b9d7baf4414e4c49a338 (patch)
tree27aee66625ac0bc491f8c8c2e65257bbedec916a /src/indicator-power.c
parent3e9263995e880ac53322ed8229ca0b47dc5a7064 (diff)
downloadayatana-indicator-power-820cc22b429e6b89f107b9d7baf4414e4c49a338.tar.gz
ayatana-indicator-power-820cc22b429e6b89f107b9d7baf4414e4c49a338.tar.bz2
ayatana-indicator-power-820cc22b429e6b89f107b9d7baf4414e4c49a338.zip
tweak: in put_primary_device(), peek at the variant's strings instead of dup'ing them
Diffstat (limited to 'src/indicator-power.c')
-rw-r--r--src/indicator-power.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index cf16fbf..1b3794e 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -785,15 +785,15 @@ put_primary_device (IndicatorPower *self,
gchar *short_details = NULL;
gchar *details = NULL;
gchar *accessible_name = NULL;
- gchar *device_icon = NULL;
- gchar *object_path = NULL;
+ const gchar *device_icon = NULL;
+ const gchar *object_path = NULL;
gdouble percentage;
guint64 time;
const gchar *device_name;
/* set the icon and text */
g_variant_get (device,
- "(susdut)",
+ "(&su&sdut)",
&object_path,
&kind,
&device_icon,
@@ -825,8 +825,6 @@ put_primary_device (IndicatorPower *self,
g_free (short_details);
g_free (details);
g_free (accessible_name);
- g_free (device_icon);
- g_free (object_path);
}
static void