From 560378aaca1784ba19806a0414a32b20c744de39 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 3 Jan 2011 04:12:51 +0000 Subject: Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1 NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kded/vfolder_menu.cpp | 136 +++++++++++++++++++++++++------------------------- 1 file changed, 68 insertions(+), 68 deletions(-) (limited to 'kded/vfolder_menu.cpp') diff --git a/kded/vfolder_menu.cpp b/kded/vfolder_menu.cpp index b48662cb2..e939d40e9 100644 --- a/kded/vfolder_menu.cpp +++ b/kded/vfolder_menu.cpp @@ -39,7 +39,7 @@ static void foldNode(TQDomElement &docElem, TQDomElement &e, TQMap::iterator it = dupeList.find(s); + TQMap::iterator it = dupeList.tqfind(s); if (it != dupeList.end()) { kdDebug(7021) << e.tagName() << " and " << s << " requires combining!" << endl; @@ -50,7 +50,7 @@ static void foldNode(TQDomElement &docElem, TQDomElement &e, TQMap *includeList, TQDict *excludeList, TQDict *itemList, const TQString &comment) { - if (itemList->find(menuId)) - printf("%s: %s INCL %d EXCL %d\n", menuName.latin1(), comment.latin1(), includeList->find(menuId) ? 1 : 0, excludeList->find(menuId) ? 1 : 0); + if (itemList->tqfind(menuId)) + printf("%s: %s INCL %d EXCL %d\n", menuName.latin1(), comment.latin1(), includeList->tqfind(menuId) ? 1 : 0, excludeList->tqfind(menuId) ? 1 : 0); } void @@ -117,7 +117,7 @@ VFolderMenu::includeItems(TQDict *items1, TQDict *items2) { for(TQDictIterator it(*items2); it.current(); ++it) { - items1->replace(it.current()->menuId(), it.current()); + items1->tqreplace(it.current()->menuId(), it.current()); } } @@ -128,7 +128,7 @@ VFolderMenu::matchItems(TQDict *items1, TQDict *items2) { TQString id = it.current()->menuId(); ++it; - if (!items2->find(id)) + if (!items2->tqfind(id)) items1->remove(id); } } @@ -145,7 +145,7 @@ VFolderMenu::excludeItems(TQDict *items1, TQDict *items2) VFolderMenu::SubMenu* VFolderMenu::takeSubMenu(SubMenu *parentMenu, const TQString &menuName) { - int i = menuName.find('/'); + int i = menuName.tqfind('/'); TQString s1 = i > 0 ? menuName.left(i) : menuName; TQString s2 = menuName.mid(i+1); @@ -205,8 +205,8 @@ VFolderMenu::mergeMenu(SubMenu *menu1, SubMenu *menu2, bool reversePriority) menu1->directoryFile = menu2->directoryFile; if (menu1->defaultLayoutNode.isNull()) menu1->defaultLayoutNode = menu2->defaultLayoutNode; - if (menu1->layoutNode.isNull()) - menu1->layoutNode = menu2->layoutNode; + if (menu1->tqlayoutNode.isNull()) + menu1->tqlayoutNode = menu2->tqlayoutNode; } else { @@ -215,8 +215,8 @@ VFolderMenu::mergeMenu(SubMenu *menu1, SubMenu *menu2, bool reversePriority) menu1->directoryFile = menu2->directoryFile; if (!menu2->defaultLayoutNode.isNull()) menu1->defaultLayoutNode = menu2->defaultLayoutNode; - if (!menu2->layoutNode.isNull()) - menu1->layoutNode = menu2->layoutNode; + if (!menu2->tqlayoutNode.isNull()) + menu1->tqlayoutNode = menu2->tqlayoutNode; } if (m_track) @@ -231,7 +231,7 @@ VFolderMenu::mergeMenu(SubMenu *menu1, SubMenu *menu2, bool reversePriority) void VFolderMenu::insertSubMenu(SubMenu *parentMenu, const TQString &menuName, SubMenu *newMenu, bool reversePriority) { - int i = menuName.find('/'); + int i = menuName.tqfind('/'); TQString s1 = menuName.left(i); TQString s2 = menuName.mid(i+1); @@ -271,12 +271,12 @@ VFolderMenu::insertSubMenu(SubMenu *parentMenu, const TQString &menuName, SubMen void VFolderMenu::insertService(SubMenu *parentMenu, const TQString &name, KService *newService) { - int i = name.find('/'); + int i = name.tqfind('/'); if (i == -1) { // Add it here - parentMenu->items.replace(newService->menuId(), newService); + parentMenu->items.tqreplace(newService->menuId(), newService); return; } @@ -324,19 +324,19 @@ VFolderMenu::~VFolderMenu() for(appsInfo *info = m_appsInfoStack.first(); \ info; info = m_appsInfoStack.next()) \ { \ - KService::List *list = info->dictCategories.find(category); \ + KService::List *list = info->dictCategories.tqfind(category); \ if (list) for(KService::List::ConstIterator it = list->begin(); \ it != list->end(); ++it) \ { #define FOR_CATEGORY_END } } KService * -VFolderMenu::findApplication(const TQString &relPath) +VFolderMenu::tqfindApplication(const TQString &relPath) { for(appsInfo *info = m_appsInfoStack.first(); info; info = m_appsInfoStack.next()) { - KService *s = info->applications.find(relPath); + KService *s = info->applications.tqfind(relPath); if (s) return s; } @@ -347,7 +347,7 @@ void VFolderMenu::addApplication(const TQString &id, KService *service) { service->setMenuId(id); - m_appsInfo->applications.replace(id, service); + m_appsInfo->applications.tqreplace(id, service); } void @@ -364,7 +364,7 @@ VFolderMenu::buildApplicationIndex(bool unusedOnly) KService *s = it.current(); TQDictIterator tmpIt = it; ++it; - if (unusedOnly && m_usedAppsDict.find(s->menuId())) + if (unusedOnly && m_usedAppsDict.tqfind(s->menuId())) { // Remove and skip this one info->applications.remove(tmpIt.currentKey()); @@ -376,7 +376,7 @@ VFolderMenu::buildApplicationIndex(bool unusedOnly) it2 != cats.end(); ++it2) { const TQString &cat = *it2; - KService::List *list = info->dictCategories.find(cat); + KService::List *list = info->dictCategories.tqfind(cat); if (!list) { list = new KService::List(); @@ -546,7 +546,7 @@ VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name) TQMap directoryDirNodes; TQMap legacyDirNodes; TQDomElement defaultLayoutNode; - TQDomElement layoutNode; + TQDomElement tqlayoutNode; TQDomNode n = docElem.firstChild(); while( !n.isNull() ) { @@ -556,17 +556,17 @@ VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name) } else if( e.tagName() == "DefaultAppDirs") { // Replace with m_defaultAppDirs - replaceNode(docElem, n, m_defaultAppDirs, "AppDir"); + tqreplaceNode(docElem, n, m_defaultAppDirs, "AppDir"); continue; } else if( e.tagName() == "DefaultDirectoryDirs") { // Replace with m_defaultDirectoryDirs - replaceNode(docElem, n, m_defaultDirectoryDirs, "DirectoryDir"); + tqreplaceNode(docElem, n, m_defaultDirectoryDirs, "DirectoryDir"); continue; } else if( e.tagName() == "DefaultMergeDirs") { // Replace with m_defaultMergeDirs - replaceNode(docElem, n, m_defaultMergeDirs, "MergeDir"); + tqreplaceNode(docElem, n, m_defaultMergeDirs, "MergeDir"); continue; } else if( e.tagName() == "AppDir") { @@ -603,7 +603,7 @@ VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name) else if( e.tagName() == "Menu") { TQString name; mergeMenus(e, name); - TQMap::iterator it = menuNodes.find(name); + TQMap::iterator it = menuNodes.tqfind(name); if (it != menuNodes.end()) { TQDomElement docElem2 = *it; @@ -684,9 +684,9 @@ VFolderMenu::mergeMenus(TQDomElement &docElem, TQString &name) defaultLayoutNode = e; } else if( e.tagName() == "Layout") { - if (!layoutNode.isNull()) - docElem.removeChild(layoutNode); - layoutNode = e; + if (!tqlayoutNode.isNull()) + docElem.removeChild(tqlayoutNode); + tqlayoutNode = e; } n = n.nextSibling(); } @@ -719,7 +719,7 @@ VFolderMenu::pushDocInfo(const TQString &fileName, const TQString &baseDir) return; } int i; - i = baseName.findRev('/'); + i = baseName.tqfindRev('/'); if (i > 0) { m_docInfo.baseDir = baseName.left(i+1); @@ -739,7 +739,7 @@ VFolderMenu::pushDocInfoParent(const TQString &basePath, const TQString &baseDir m_docInfo.baseDir = baseDir; - TQString fileName = basePath.mid(basePath.findRev('/')+1); + TQString fileName = basePath.mid(basePath.tqfindRev('/')+1); m_docInfo.baseName = fileName.left( fileName.length() - 5 ); TQString baseName = TQDir::cleanDirPath(m_docInfo.baseDir + fileName); @@ -937,7 +937,7 @@ VFolderMenu::processCondition(TQDomElement &domElem, TQDict *items) FOR_ALL_APPLICATIONS(it) { KService *s = it.current(); - items->replace(s->menuId(), s); + items->tqreplace(s->menuId(), s); } FOR_ALL_APPLICATIONS_END @@ -958,7 +958,7 @@ VFolderMenu::processCondition(TQDomElement &domElem, TQDict *items) FOR_CATEGORY(domElem.text(), it) { KService *s = *it; - items->replace(s->menuId(), s); + items->tqreplace(s->menuId(), s); } FOR_CATEGORY_END } @@ -967,7 +967,7 @@ VFolderMenu::processCondition(TQDomElement &domElem, TQDict *items) FOR_ALL_APPLICATIONS(it) { KService *s = it.current(); - items->replace(s->menuId(), s); + items->tqreplace(s->menuId(), s); } FOR_ALL_APPLICATIONS_END } @@ -975,9 +975,9 @@ VFolderMenu::processCondition(TQDomElement &domElem, TQDict *items) { TQString filename = domElem.text(); kdDebug(7021) << "Adding file " << filename << endl; - KService *s = findApplication(filename); + KService *s = tqfindApplication(filename); if (s) - items->replace(filename, s); + items->tqreplace(filename, s); } } @@ -1071,7 +1071,7 @@ kdDebug(7021) << "processKDELegacyDirs()" << endl; { TQString id = name; // Strip path from id - int i = id.findRev('/'); + int i = id.tqfindRev('/'); if (i >= 0) id = id.mid(i+1); @@ -1079,7 +1079,7 @@ kdDebug(7021) << "processKDELegacyDirs()" << endl; // TODO: add Legacy category addApplication(id, service); - items.replace(service->menuId(), service); + items.tqreplace(service->menuId(), service); if (service->categories().isEmpty()) insertService(m_currentMenu, name, service); @@ -1144,10 +1144,10 @@ kdDebug(7021) << "processLegacyDir(" << dir << ", " << relDir << ", " << prefix // TODO: Add legacy category addApplication(id, service); - items.replace(service->menuId(), service); + items.tqreplace(service->menuId(), service); if (service->categories().isEmpty()) - m_currentMenu->items.replace(id, service); + m_currentMenu->items.tqreplace(id, service); } } } @@ -1169,7 +1169,7 @@ VFolderMenu::processMenu(TQDomElement &docElem, int pass) bool isDeleted = false; bool kdeLegacyDirsDone = false; TQDomElement defaultLayoutNode; - TQDomElement layoutNode; + TQDomElement tqlayoutNode; TQDomElement query; TQDomNode n = docElem.firstChild(); @@ -1211,7 +1211,7 @@ VFolderMenu::processMenu(TQDomElement &docElem, int pass) } else if (e.tagName() == "Layout") { - layoutNode = e; + tqlayoutNode = e; } n = n.nextSibling(); } @@ -1256,7 +1256,7 @@ VFolderMenu::processMenu(TQDomElement &docElem, int pass) m_currentMenu->isDeleted = isDeleted; m_currentMenu->defaultLayoutNode = defaultLayoutNode; - m_currentMenu->layoutNode = layoutNode; + m_currentMenu->tqlayoutNode = tqlayoutNode; } else { @@ -1305,7 +1305,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << endl; processKDELegacyDirs(); - m_legacyNodes.replace("", m_currentMenu); + m_legacyNodes.tqreplace("", m_currentMenu); m_currentMenu = oldMenu; kdeLegacyDirsDone = true; @@ -1318,7 +1318,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << endl; TQString prefix = e.attributes().namedItem("prefix").toAttr().value(); - if (m_defaultLegacyDirs.contains(dir)) + if (m_defaultLegacyDirs.tqcontains(dir)) { if (!kdeLegacyDirsDone) { @@ -1328,7 +1328,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl; processKDELegacyDirs(); - m_legacyNodes.replace("", m_currentMenu); + m_legacyNodes.tqreplace("", m_currentMenu); m_currentMenu = oldMenu; kdeLegacyDirsDone = true; @@ -1343,7 +1343,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl; processLegacyDir(dir, TQString::null, prefix); - m_legacyNodes.replace(dir, m_currentMenu); + m_legacyNodes.tqreplace(dir, m_currentMenu); m_currentMenu = oldMenu; } } @@ -1421,7 +1421,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl; { // Add legacy nodes to Menu structure TQString dir = absoluteDir(e.text(), e.attribute("__BaseDir")); - SubMenu *legacyMenu = m_legacyNodes.find(dir); + SubMenu *legacyMenu = m_legacyNodes.tqfind(dir); if (legacyMenu) { mergeMenu(m_currentMenu, legacyMenu); @@ -1432,7 +1432,7 @@ kdDebug(7021) << "Processing KDE Legacy dirs for " << dir << endl; { // Add legacy nodes to Menu structure TQString dir = ""; - SubMenu *legacyMenu = m_legacyNodes.find(dir); + SubMenu *legacyMenu = m_legacyNodes.tqfind(dir); if (legacyMenu) { mergeMenu(m_currentMenu, legacyMenu); @@ -1546,70 +1546,70 @@ static TQString parseAttribute( const TQDomElement &e) static TQStringList parseLayoutNode(const TQDomElement &docElem) { - TQStringList layout; + TQStringList tqlayout; TQString optionDefaultLayout; if( docElem.tagName()=="DefaultLayout") optionDefaultLayout = parseAttribute( docElem); if ( !optionDefaultLayout.isEmpty() ) - layout.append( optionDefaultLayout ); + tqlayout.append( optionDefaultLayout ); TQDomNode n = docElem.firstChild(); while( !n.isNull() ) { TQDomElement e = n.toElement(); // try to convert the node to an element. if (e.tagName() == "Separator") { - layout.append(":S"); + tqlayout.append(":S"); } else if (e.tagName() == "Filename") { - layout.append(e.text()); + tqlayout.append(e.text()); } else if (e.tagName() == "Menuname") { - layout.append("/"+e.text()); + tqlayout.append("/"+e.text()); TQString option = parseAttribute( e ); if( !option.isEmpty()) - layout.append( option ); + tqlayout.append( option ); } else if (e.tagName() == "Merge") { TQString type = e.attributeNode("type").value(); if (type == "files") - layout.append(":F"); + tqlayout.append(":F"); else if (type == "menus") - layout.append(":M"); + tqlayout.append(":M"); else if (type == "all") - layout.append(":A"); + tqlayout.append(":A"); } n = n.nextSibling(); } - return layout; + return tqlayout; } void -VFolderMenu::layoutMenu(VFolderMenu::SubMenu *menu, TQStringList defaultLayout) +VFolderMenu::tqlayoutMenu(VFolderMenu::SubMenu *menu, TQStringList defaultLayout) { if (!menu->defaultLayoutNode.isNull()) { defaultLayout = parseLayoutNode(menu->defaultLayoutNode); } - if (menu->layoutNode.isNull()) + if (menu->tqlayoutNode.isNull()) { - menu->layoutList = defaultLayout; + menu->tqlayoutList = defaultLayout; } else { - menu->layoutList = parseLayoutNode(menu->layoutNode); - if (menu->layoutList.isEmpty()) - menu->layoutList = defaultLayout; + menu->tqlayoutList = parseLayoutNode(menu->tqlayoutNode); + if (menu->tqlayoutList.isEmpty()) + menu->tqlayoutList = defaultLayout; } for(VFolderMenu::SubMenu *subMenu = menu->subMenus.first(); subMenu; subMenu = menu->subMenus.next()) { - layoutMenu(subMenu, defaultLayout); + tqlayoutMenu(subMenu, defaultLayout); } } @@ -1618,7 +1618,7 @@ VFolderMenu::markUsedApplications(TQDict *items) { for(TQDictIterator it(*items); it.current(); ++it) { - m_usedAppsDict.replace(it.current()->menuId(), it.current()); + m_usedAppsDict.tqreplace(it.current()->menuId(), it.current()); } } @@ -1660,7 +1660,7 @@ VFolderMenu::parseMenu(const TQString &file, bool forceLegacyLoad) TQStringList defaultLayout; defaultLayout << ":M"; // Sub-Menus defaultLayout << ":F"; // Individual entries - layoutMenu(m_rootMenu, defaultLayout); + tqlayoutMenu(m_rootMenu, defaultLayout); } } -- cgit v1.2.1