diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-01-25 12:21:51 +0100 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2012-01-25 12:21:51 +0100 |
commit | c9df18becfc38ab3e3a833d0095c26f5140800e1 (patch) | |
tree | 99b39f64e32ddd71343ea8f1caff59685363d7e4 /libindicator | |
parent | 0373d6fcb3f7b62028db4978ba215c403b43fed9 (diff) | |
download | libayatana-indicator-c9df18becfc38ab3e3a833d0095c26f5140800e1.tar.gz libayatana-indicator-c9df18becfc38ab3e3a833d0095c26f5140800e1.tar.bz2 libayatana-indicator-c9df18becfc38ab3e3a833d0095c26f5140800e1.zip |
Indicator-Object: update the parent_object value only if the entry is valid.
Diffstat (limited to 'libindicator')
-rw-r--r-- | libindicator/indicator-object.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c index 6e25387..91f45ff 100644 --- a/libindicator/indicator-object.c +++ b/libindicator/indicator-object.c @@ -348,7 +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); } - entry->parent_object = NULL; + + if (entry) + entry->parent_object = NULL; } g_list_free (entries); @@ -568,7 +570,9 @@ get_all_entries (IndicatorObject * io) for (l = all_entries; l; l = l->next) { IndicatorObjectEntry *entry = l->data; - entry->parent_object = io; + + if (entry) + entry->parent_object = io; } } @@ -768,10 +772,14 @@ indicator_object_entry_being_removed (IndicatorObject * io, IndicatorObjectEntry IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); entry_get_private (io, entry)->visibility = ENTRY_INVISIBLE; - entry->parent_object = NULL; if (class->entry_being_removed != NULL) + { + if (entry) + entry->parent_object = NULL; + class->entry_being_removed (io, entry); + } } static void @@ -781,10 +789,14 @@ indicator_object_entry_was_added (IndicatorObject * io, IndicatorObjectEntry * e IndicatorObjectClass * class = INDICATOR_OBJECT_GET_CLASS(io); entry_get_private (io, entry)->visibility = ENTRY_VISIBLE; - entry->parent_object = io; if (class->entry_was_added != NULL) + { + if (entry) + entry->parent_object = io; + class->entry_was_added (io, entry); + } } /** |