aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarco Trevisan (Treviño) <mail@3v1n0.net>2012-01-25 11:55:37 +0100
committerMarco Trevisan (Treviño) <mail@3v1n0.net>2012-01-25 11:55:37 +0100
commit0373d6fcb3f7b62028db4978ba215c403b43fed9 (patch)
tree0f336ef3c5436a841372a2c3809c31c1d7f0825d
parentdbccdd5fd7c0850af8ffd411f906dc43785e599b (diff)
downloadlibayatana-indicator-0373d6fcb3f7b62028db4978ba215c403b43fed9.tar.gz
libayatana-indicator-0373d6fcb3f7b62028db4978ba215c403b43fed9.tar.bz2
libayatana-indicator-0373d6fcb3f7b62028db4978ba215c403b43fed9.zip
IndicatorObject: correctly initialize the parent object.
-rw-r--r--libindicator/indicator-object.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index 849fb9f..6e25387 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -348,6 +348,7 @@ 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;
}
g_list_free (entries);
@@ -507,6 +508,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 +554,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 +562,16 @@ 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;
+ entry->parent_object = io;
+ }
+ }
+
return all_entries;
}
@@ -757,6 +768,7 @@ 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)
class->entry_being_removed (io, entry);
@@ -769,6 +781,7 @@ 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)
class->entry_was_added (io, entry);