aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libindicator/indicator-object.c1
-rw-r--r--libindicator/indicator-object.h2
-rw-r--r--tests/test-loader.c1
-rw-r--r--tools/indicator-loader.c4
4 files changed, 8 insertions, 0 deletions
diff --git a/libindicator/indicator-object.c b/libindicator/indicator-object.c
index a35a2fa..849fb9f 100644
--- a/libindicator/indicator-object.c
+++ b/libindicator/indicator-object.c
@@ -308,6 +308,7 @@ indicator_object_init (IndicatorObject *self)
priv->module = NULL;
+ priv->entry.parent_object = self;
priv->entry.menu = NULL;
priv->entry.label = NULL;
priv->entry.image = NULL;
diff --git a/libindicator/indicator-object.h b/libindicator/indicator-object.h
index ca78437..2d69b1b 100644
--- a/libindicator/indicator-object.h
+++ b/libindicator/indicator-object.h
@@ -164,6 +164,7 @@ struct _IndicatorObject {
/**
IndicatorObjectEntry:
+ @parent_object: The #IndicatorObject that created this entry
@label: The label to be shown on the panel
@image: The image to be shown on the panel
@menu: The menu to be added to the menubar
@@ -178,6 +179,7 @@ struct _IndicatorObject {
@reserved4: Reserved for future use
*/
struct _IndicatorObjectEntry {
+ IndicatorObject * parent_object;
GtkLabel * label;
GtkImage * image;
GtkMenu * menu;
diff --git a/tests/test-loader.c b/tests/test-loader.c
index 0ea3224..6f9d25b 100644
--- a/tests/test-loader.c
+++ b/tests/test-loader.c
@@ -241,6 +241,7 @@ test_loader_filename_dummy_simple_location (void)
g_assert(indicator_object_get_location(object, (IndicatorObjectEntry *)entries->data) == 0);
g_assert(indicator_object_get_location(object, NULL) == 0);
+ g_assert(((IndicatorObjectEntry *)entries->data)->parent_object != NULL);
g_object_unref(object);
diff --git a/tools/indicator-loader.c b/tools/indicator-loader.c
index 59e90b1..10952dc 100644
--- a/tools/indicator-loader.c
+++ b/tools/indicator-loader.c
@@ -45,6 +45,10 @@ entry_added (IndicatorObject * io, IndicatorObjectEntry * entry, gpointer user_d
{
g_debug("Signal: Entry Added");
+ if (entry->parent_object == NULL) {
+ g_warning("Entry '%p' does not have a parent object", entry);
+ }
+
GtkWidget * menuitem = gtk_menu_item_new();
#if GTK_CHECK_VERSION(3,0,0)
GtkWidget * hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 3);