diff options
author | Ted Gould <ted@gould.cx> | 2012-02-03 09:48:05 -0600 |
---|---|---|
committer | Ted Gould <ted@gould.cx> | 2012-02-03 09:48:05 -0600 |
commit | 238865c76b62cc140136a7ce166c9f2ea032678d (patch) | |
tree | c09cf61764bd35f41fd476a53619a0e913c50f49 /libindicator | |
parent | dbccdd5fd7c0850af8ffd411f906dc43785e599b (diff) | |
parent | 7ae413b583259eb8c312511c4da5f0558d2daab9 (diff) | |
download | libayatana-indicator-238865c76b62cc140136a7ce166c9f2ea032678d.tar.gz libayatana-indicator-238865c76b62cc140136a7ce166c9f2ea032678d.tar.bz2 libayatana-indicator-238865c76b62cc140136a7ce166c9f2ea032678d.zip |
Be more agressive in ensureing the parent_object value is available everywhere.
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-object.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 849fb9f..d0b3ecf 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -348,6 +348,9 @@ indicator_object_dispose (GObject *object) if (entry_get_private(io, entry)->visibility == ENTRY_INVISIBLE) { g_signal_emit(io, signals[ENTRY_ADDED], detail, entry); } + + if (entry) + entry->parent_object = NULL; } g_list_free (entries); @@ -507,6 +510,8 @@ get_entries_default (IndicatorObject * io) if (!priv->gotten_entries) { IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); + priv->entry.parent_object = io; + if (class->get_label) { priv->entry.label = class->get_label(io); } @@ -551,7 +556,7 @@ get_entries_default (IndicatorObject * io) static GList* get_all_entries (IndicatorObject * io) { - GList * all_entries = NULL; + GList * all_entries = NULL, *l; g_return_val_if_fail(INDICATOR_IS_OBJECT(io), NULL); IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); @@ -559,8 +564,18 @@ get_all_entries (IndicatorObject * io) if (class->get_entries == NULL) g_error("No get_entries function on object. It must have been deleted?!?!"); else + { all_entries = class->get_entries(io); + for (l = all_entries; l; l = l->next) + { + IndicatorObjectEntry *entry = l->data; + + if (entry) + entry->parent_object = io; + } + } + return all_entries; } @@ -758,8 +773,13 @@ indicator_object_entry_being_removed (IndicatorObject * io, IndicatorObjectEntry entry_get_private (io, entry)->visibility = ENTRY_INVISIBLE; + if (entry) + entry->parent_object = NULL; + if (class->entry_being_removed != NULL) + { class->entry_being_removed (io, entry); + } } static void @@ -770,8 +790,13 @@ indicator_object_entry_was_added (IndicatorObject * io, IndicatorObjectEntry * e entry_get_private (io, entry)->visibility = ENTRY_VISIBLE; + if (entry) + entry->parent_object = io; + if (class->entry_was_added != NULL) + { class->entry_was_added (io, entry); + } } /** |