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.cpp71
1 files changed, 31 insertions, 40 deletions
diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp
index 408c6af9a..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)
{
@@ -775,8 +756,8 @@ VFolderMenu::locateMenuFile(const TQString &fileName)
TQString result;
//TQString xdgMenuPrefix = TQString::fromLocal8Bit(getenv("XDG_MENU_PREFIX"));
- // hardcode xdgMenuPrefix to "kde-" string until proper upstream fix
- TQString xdgMenuPrefix = "kde-";
+ // hardcode xdgMenuPrefix to "tde-" string until proper upstream fix
+ TQString xdgMenuPrefix = "tde-";
if (!xdgMenuPrefix.isEmpty())
{
TQFileInfo fileInfo(fileName);
@@ -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")
{
@@ -1032,7 +1023,7 @@ VFolderMenu::processKDELegacyDirs()
kdDebug(7021) << "processKDELegacyDirs()" << endl;
TQDict<KService> items;
- TQString prefix = "kde-";
+ TQString prefix = "tde-";
TQStringList relFiles;
TQRegExp files("\\.(desktop|kdelnk)$");