aboutsummaryrefslogtreecommitdiff
path: root/src/app-menu-item.c
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-02-18 08:41:56 -0600
committerTed Gould <ted@gould.cx>2010-02-18 08:41:56 -0600
commit06a4fba68ccbdc5b490cd8a9709e4426ec80a0ff (patch)
treecc383474030843f7bb5f4009eb845c10e136b16a /src/app-menu-item.c
parent536034bb020f39dcf45d9a0d636f3f5dbd55deb7 (diff)
downloadayatana-indicator-messages-06a4fba68ccbdc5b490cd8a9709e4426ec80a0ff.tar.gz
ayatana-indicator-messages-06a4fba68ccbdc5b490cd8a9709e4426ec80a0ff.tar.bz2
ayatana-indicator-messages-06a4fba68ccbdc5b490cd8a9709e4426ec80a0ff.zip
Adding protection from data fields by checking to ensure they're AppMenuItems
Diffstat (limited to 'src/app-menu-item.c')
-rw-r--r--src/app-menu-item.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/app-menu-item.c b/src/app-menu-item.c
index 8e1c50f..2fb24f6 100644
--- a/src/app-menu-item.c
+++ b/src/app-menu-item.c
@@ -254,6 +254,7 @@ update_label (AppMenuItem * self)
static void
count_changed (IndicateListener * listener, IndicateListenerServer * server, guint count, gpointer data)
{
+ g_return_if_fail(IS_APP_MENU_ITEM(data));
AppMenuItem * self = APP_MENU_ITEM(data);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
@@ -282,6 +283,7 @@ count_cb (IndicateListener * listener, IndicateListenerServer * server, guint va
static void
desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * value, gpointer data)
{
+ g_return_if_fail(IS_APP_MENU_ITEM(data));
AppMenuItem * self = APP_MENU_ITEM(data);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
@@ -315,6 +317,7 @@ desktop_cb (IndicateListener * listener, IndicateListenerServer * server, gchar
static void
child_added_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint position, gpointer data)
{
+ g_return_if_fail(IS_APP_MENU_ITEM(data));
AppMenuItem * self = APP_MENU_ITEM(data);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
DbusmenuMenuitemProxy * mip = dbusmenu_menuitem_proxy_new(child);
@@ -330,6 +333,7 @@ child_added_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint positio
static void
child_removed_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer data)
{
+ g_return_if_fail(IS_APP_MENU_ITEM(data));
AppMenuItem * self = APP_MENU_ITEM(data);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
@@ -360,6 +364,7 @@ child_removed_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, gpointer da
static void
child_moved_cb (DbusmenuMenuitem * root, DbusmenuMenuitem * child, guint newpos, guint oldpos, gpointer data)
{
+ g_return_if_fail(IS_APP_MENU_ITEM(data));
AppMenuItem * self = APP_MENU_ITEM(data);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);
@@ -435,6 +440,7 @@ static void
menu_cb (IndicateListener * listener, IndicateListenerServer * server, gchar * menupath, gpointer data)
{
g_debug("Got Menu: %s", menupath);
+ g_return_if_fail(IS_APP_MENU_ITEM(data));
AppMenuItem * self = APP_MENU_ITEM(data);
AppMenuItemPrivate * priv = APP_MENU_ITEM_GET_PRIVATE(self);