aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2010-04-15 21:59:41 -0500
committerTed Gould <ted@gould.cx>2010-04-15 21:59:41 -0500
commit5f4f845baf5171e73bd38d33cfd503f7200f162b (patch)
tree3562eaf82d249a28c6aa87d24d0518d6ac2e76f0
parent30b853eaf97907008044d5a7fb052359eef59b49 (diff)
downloadayatana-indicator-messages-5f4f845baf5171e73bd38d33cfd503f7200f162b.tar.gz
ayatana-indicator-messages-5f4f845baf5171e73bd38d33cfd503f7200f162b.tar.bz2
ayatana-indicator-messages-5f4f845baf5171e73bd38d33cfd503f7200f162b.zip
Minor refactoring to make the logic clearer
-rw-r--r--src/messages-service.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/messages-service.c b/src/messages-service.c
index 2e85faa..bd69d7b 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -615,20 +615,24 @@ server_shortcuts_changed (AppMenuItem * appitem, gpointer data)
gboolean appitemfound = FALSE;
GList * children = dbusmenu_menuitem_get_children(shell);
GList * removelist = NULL;
+ guint position = -1;
while (children != NULL) {
- if (!appitemfound && children->data != appitem) {
+ position++;
+ if (children->data == appitem) {
+ g_debug("\tApp entry found at position %d", position);
children = g_list_next(children);
+ appitemfound = TRUE;
continue;
}
- appitemfound = TRUE;
- if (children->data == appitem) {
+ if (!appitemfound) {
children = g_list_next(children);
continue;
}
if (!DBUSMENU_IS_MENUITEM_PROXY(children->data)) {
+ g_debug("\tNon-proxy item (%s) found at %d: %s", G_OBJECT_TYPE_NAME(children->data), position, dbusmenu_menuitem_property_get(DBUSMENU_MENUITEM(children->data), DBUSMENU_MENUITEM_PROP_LABEL));
break;
}