aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-01-24 11:25:11 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-01-24 11:25:11 +0100
commit088b36be863ed966426754b1505009967254293c (patch)
tree710d5e87b8206922ee0f4881e1e182641b7a94a4
parent05535f5916cdcb3a23334b6cb7b323f5508257ef (diff)
downloadlibayatana-indicator-088b36be863ed966426754b1505009967254293c.tar.gz
libayatana-indicator-088b36be863ed966426754b1505009967254293c.tar.bz2
libayatana-indicator-088b36be863ed966426754b1505009967254293c.zip
indicator-ng: save unnecessary allocations by using "&" in g_variant_get
-rw-r--r--libindicator/indicator-ng.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/libindicator/indicator-ng.c b/libindicator/indicator-ng.c
index be73eb3..b7ea334 100644
--- a/libindicator/indicator-ng.c
+++ b/libindicator/indicator-ng.c
@@ -200,21 +200,17 @@ indicator_ng_update_entry (IndicatorNg *self)
state = g_action_group_get_action_state (self->actions, self->header_action);
if (state && g_variant_is_of_type (state, G_VARIANT_TYPE ("(sssb)")))
{
- gchar *label;
- gchar *iconstr;
- gchar *accessible_desc;
+ const gchar *label;
+ const gchar *iconstr;
+ const gchar *accessible_desc;
gboolean visible;
- g_variant_get (state, "(sssb)", &label, &iconstr, &accessible_desc, &visible);
+ g_variant_get (state, "(&s&s&sb)", &label, &iconstr, &accessible_desc, &visible);
gtk_label_set_label (GTK_LABEL (self->entry.label), label);
indicator_ng_set_icon_from_string (self, iconstr);
indicator_ng_set_accessible_desc (self, accessible_desc);
indicator_object_set_visible (INDICATOR_OBJECT (self), visible);
-
- g_free (label);
- g_free (iconstr);
- g_free (accessible_desc);
}
else
g_warning ("the action of the indicator menu item must have state with type (sssb)");