aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-02-22 15:25:29 -0600
committerCharles Kerr <charles.kerr@canonical.com>2012-02-22 15:25:29 -0600
commit947e415ae432d1f0ec0d95955c0d8a71323eb4c1 (patch)
tree26f572cc3f19d14c57017513e0e44ce96dab1398 /src
parente1c4456df917b94c413f5a4ff4e57df886b190c7 (diff)
downloadayatana-indicator-power-947e415ae432d1f0ec0d95955c0d8a71323eb4c1.tar.gz
ayatana-indicator-power-947e415ae432d1f0ec0d95955c0d8a71323eb4c1.tar.bz2
ayatana-indicator-power-947e415ae432d1f0ec0d95955c0d8a71323eb4c1.zip
fix set_accessible_desc() to update the entries' accessible_desc fields and emit the accessible-desc-changed signal
Diffstat (limited to 'src')
-rw-r--r--src/indicator-power.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/indicator-power.c b/src/indicator-power.c
index a5092c1..d3d929f 100644
--- a/src/indicator-power.c
+++ b/src/indicator-power.c
@@ -402,12 +402,23 @@ static void
set_accessible_desc (IndicatorPower *self,
const gchar *desc)
{
- if (desc == NULL || desc[0] == '\0')
- return;
-
- g_free (self->accessible_desc);
-
- self->accessible_desc = g_strdup (desc);
+ if (desc && *desc)
+ {
+ /* update our copy of the string */
+ char * old_desc = self->accessible_desc;
+ self->accessible_desc = g_strdup (desc);
+ g_free (old_desc);
+
+ /* have the entries use our string */
+ GList * l;
+ GList * entries = indicator_object_get_entries(INDICATOR_OBJECT(self));
+ for (l=entries; l!=NULL; l=l->next) {
+ IndicatorObjectEntry * entry = l->data;
+ entry->accessible_desc = self->accessible_desc;
+ g_signal_emit (self, INDICATOR_OBJECT_SIGNAL_ACCESSIBLE_DESC_UPDATE_ID, 0, entry);
+ }
+ g_list_free (entries);
+ }
}
static const gchar *