From 088b36be863ed966426754b1505009967254293c Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Thu, 24 Jan 2013 11:25:11 +0100 Subject: indicator-ng: save unnecessary allocations by using "&" in g_variant_get --- libindicator/indicator-ng.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'libindicator') 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)"); -- cgit v1.2.3