From e07deff5a9e253d9e407e75ce2293e3cbb688d12 Mon Sep 17 00:00:00 2001 From: Lars Uebernickel Date: Wed, 23 Jan 2013 17:55:08 +0100 Subject: indicator-ng: set name hint to the value of the service file's "Name" field --- libindicator/indicator-ng.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) (limited to 'libindicator/indicator-ng.c') diff --git a/libindicator/indicator-ng.c b/libindicator/indicator-ng.c index a77aa43..975ae9f 100644 --- a/libindicator/indicator-ng.c +++ b/libindicator/indicator-ng.c @@ -38,6 +38,21 @@ enum static GParamSpec *properties[N_PROPERTIES]; +static IndicatorObjectEntry * +indicator_ng_get_entry (IndicatorNg *self) +{ + GList *entries; + IndicatorObjectEntry *entry; + + entries = INDICATOR_OBJECT_GET_CLASS (self)->get_entries (INDICATOR_OBJECT (self)); + g_return_val_if_fail (entries != NULL, NULL); + + entry = entries->data; + + g_list_free (entries); + return entry; +} + static void indicator_ng_get_property (GObject *object, guint property_id, @@ -183,18 +198,14 @@ static void indicator_ng_set_accessible_desc (IndicatorNg *self, const gchar *accessible_desc) { - GList *entries; + IndicatorObjectEntry *entry; - g_free (self->accessible_desc); + entry = indicator_ng_get_entry (self); + g_free (self->accessible_desc); self->accessible_desc = g_strdup (accessible_desc); - entries = INDICATOR_OBJECT_GET_CLASS (self)->get_entries (INDICATOR_OBJECT (self)); - g_return_if_fail (entries != NULL); - - g_signal_emit_by_name (self, INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, entries->data); - - g_list_free (entries); + g_signal_emit_by_name (self, INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE, entry); } static gboolean @@ -366,6 +377,10 @@ indicator_ng_initable_init (GInitable *initable, (bus_name = g_key_file_get_string (keyfile, "Indicator Service", "BusName", error)) && (self->object_path = g_key_file_get_string (keyfile, "Indicator Service", "ObjectPath", error))) { + IndicatorObjectEntry *entry; + + entry = indicator_ng_get_entry (self); + entry->name_hint = self->name; self->name_watch_id = g_bus_watch_name (G_BUS_TYPE_SESSION, bus_name, -- cgit v1.2.3