aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Uebernickel <lars.uebernickel@canonical.com>2013-01-23 17:55:08 +0100
committerLars Uebernickel <lars.uebernickel@canonical.com>2013-01-23 17:55:08 +0100
commite07deff5a9e253d9e407e75ce2293e3cbb688d12 (patch)
treef6375a13379dfbec2e9e2e9dd0b4d3e6ee56eef6
parent739daae6ed0e8d0c95a131e5a2ea31fc2cfb4ec0 (diff)
downloadlibayatana-indicator-e07deff5a9e253d9e407e75ce2293e3cbb688d12.tar.gz
libayatana-indicator-e07deff5a9e253d9e407e75ce2293e3cbb688d12.tar.bz2
libayatana-indicator-e07deff5a9e253d9e407e75ce2293e3cbb688d12.zip
indicator-ng: set name hint to the value of the service file's "Name" field
-rw-r--r--libindicator/indicator-ng.c31
1 files changed, 23 insertions, 8 deletions
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,