diff options
author | Charles Kerr <charles.kerr@canonical.com> | 2012-02-22 15:25:29 -0600 |
---|---|---|
committer | Charles Kerr <charles.kerr@canonical.com> | 2012-02-22 15:25:29 -0600 |
commit | 947e415ae432d1f0ec0d95955c0d8a71323eb4c1 (patch) | |
tree | 26f572cc3f19d14c57017513e0e44ce96dab1398 /src/indicator-power.c | |
parent | e1c4456df917b94c413f5a4ff4e57df886b190c7 (diff) | |
download | ayatana-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/indicator-power.c')
-rw-r--r-- | src/indicator-power.c | 23 |
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 * |