summaryrefslogtreecommitdiffstats
path: root/kded/vfolder_menu.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kded/vfolder_menu.cpp')
-rw-r--r--kded/vfolder_menu.cpp65
1 files changed, 28 insertions, 37 deletions
diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp
index 2e04965ea..880a17576 100644
--- a/kded/vfolder_menu.cpp
+++ b/kded/vfolder_menu.cpp
@@ -311,25 +311,6 @@ VFolderMenu::~VFolderMenu()
delete m_rootMenu;
}
-#define FOR_ALL_APPLICATIONS(it) \
- for(appsInfo *info = m_appsInfoStack.first(); \
- info; info = m_appsInfoStack.next()) \
- { \
- for(TQDictIterator<KService> it( info->applications ); \
- it.current(); ++it ) \
- {
-#define FOR_ALL_APPLICATIONS_END } }
-
-#define FOR_CATEGORY(category, it) \
- for(appsInfo *info = m_appsInfoStack.first(); \
- info; info = m_appsInfoStack.next()) \
- { \
- KService::List *list = info->dictCategories.find(category); \
- if (list) for(KService::List::ConstIterator it = list->begin(); \
- it != list->end(); ++it) \
- {
-#define FOR_CATEGORY_END } }
-
KService *
VFolderMenu::findApplication(const TQString &relPath)
{
@@ -934,12 +915,14 @@ VFolderMenu::processCondition(TQDomElement &domElem, TQDict<KService> *items)
}
else if (domElem.tagName() == "Not")
{
- FOR_ALL_APPLICATIONS(it)
- {
- KService *s = it.current();
- items->replace(s->menuId(), s);
- }
- FOR_ALL_APPLICATIONS_END
+ for (appsInfo *info = m_appsInfoStack.first(); info; info = m_appsInfoStack.next())
+ {
+ for (TQDictIterator<KService> it( info->applications ); it.current(); ++it )
+ {
+ KService *s = it.current();
+ items->replace(s->menuId(), s);
+ }
+ }
TQDict<KService> notItems;
TQDomNode n = domElem.firstChild();
@@ -955,21 +938,29 @@ VFolderMenu::processCondition(TQDomElement &domElem, TQDict<KService> *items)
}
else if (domElem.tagName() == "Category")
{
- FOR_CATEGORY(domElem.text(), it)
- {
- KService *s = *it;
- items->replace(s->menuId(), s);
- }
- FOR_CATEGORY_END
+ for (appsInfo *info = m_appsInfoStack.first(); info; info = m_appsInfoStack.next())
+ {
+ KService::List *list = info->dictCategories.find(domElem.text());
+ if (list)
+ {
+ for(KService::List::ConstIterator it = list->begin(); it != list->end(); ++it)
+ {
+ KService *s = *it;
+ items->replace(s->menuId(), s);
+ }
+ }
+ }
}
else if (domElem.tagName() == "All")
{
- FOR_ALL_APPLICATIONS(it)
- {
- KService *s = it.current();
- items->replace(s->menuId(), s);
- }
- FOR_ALL_APPLICATIONS_END
+ for (appsInfo *info = m_appsInfoStack.first(); info; info = m_appsInfoStack.next())
+ {
+ for (TQDictIterator<KService> it( info->applications ); it.current(); ++it )
+ {
+ KService *s = it.current();
+ items->replace(s->menuId(), s);
+ }
+ }
}
else if (domElem.tagName() == "Filename")
{