diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:56:07 +0000 |
commit | d6f8bbb45b267065a6907e71ff9c98bb6d161241 (patch) | |
tree | d109539636691d7b03036ca1c0ed29dbae6577cf /src/profileengine/lib/profileengine.cpp | |
parent | 3331a47a9cad24795c7440ee8107143ce444ef34 (diff) | |
download | tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.tar.gz tdevelop-d6f8bbb45b267065a6907e71ff9c98bb6d161241.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1157658 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/profileengine/lib/profileengine.cpp')
-rw-r--r-- | src/profileengine/lib/profileengine.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/profileengine/lib/profileengine.cpp b/src/profileengine/lib/profileengine.cpp index 199c8238..af8f2afe 100644 --- a/src/profileengine/lib/profileengine.cpp +++ b/src/profileengine/lib/profileengine.cpp @@ -18,7 +18,7 @@ ***************************************************************************/ #include "profileengine.h" -#include <qdir.h> +#include <tqdir.h> #include <kurl.h> #include <kdebug.h> @@ -29,14 +29,14 @@ ProfileEngine::ProfileEngine() { - QStringList dirs = KGlobal::dirs()->findDirs("data", "kdevelop/profiles"); + TQStringList dirs = KGlobal::dirs()->findDirs("data", "kdevelop/profiles"); m_rootProfile = new Profile(0, "KDevelop"); - QString currPath = "/"; - QMap<QString, Profile*> passedPaths; + TQString currPath = "/"; + TQMap<TQString, Profile*> passedPaths; - for (QStringList::const_iterator it = dirs.constBegin(); it != dirs.constEnd(); ++it) + for (TQStringList::const_iterator it = dirs.constBegin(); it != dirs.constEnd(); ++it) processDir(*it, currPath, passedPaths, m_rootProfile); } @@ -45,17 +45,17 @@ ProfileEngine::~ProfileEngine() delete m_rootProfile; } -void ProfileEngine::processDir(const QString &dir, const QString &currPath, QMap<QString, Profile*> &passedPaths, Profile *root) +void ProfileEngine::processDir(const TQString &dir, const TQString &currPath, TQMap<TQString, Profile*> &passedPaths, Profile *root) { // kdDebug() << "processDir: " << dir << " " << currPath << endl; - QDir qDir(dir); - QStringList entryList = qDir.entryList(QDir::Dirs); - for (QStringList::const_iterator eit = entryList.constBegin(); eit != entryList.constEnd(); ++eit) + TQDir qDir(dir); + TQStringList entryList = qDir.entryList(TQDir::Dirs); + for (TQStringList::const_iterator eit = entryList.constBegin(); eit != entryList.constEnd(); ++eit) { if ((*eit != "..") && (*eit != ".")) { - QString dirName = *eit; + TQString dirName = *eit; Profile *profile = 0; if (passedPaths.contains(currPath + dirName)) profile = passedPaths[currPath + dirName]; @@ -69,7 +69,7 @@ void ProfileEngine::processDir(const QString &dir, const QString &currPath, QMap } } -KTrader::OfferList ProfileEngine::offers(const QString &profileName, OfferType offerType) +KTrader::OfferList ProfileEngine::offers(const TQString &profileName, OfferType offerType) { ProfileListing listing; Profile *profile = 0; @@ -78,23 +78,23 @@ KTrader::OfferList ProfileEngine::offers(const QString &profileName, OfferType o if (!profile) return KTrader::OfferList(); - QString constraint = QString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION); + TQString constraint = TQString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION); switch (offerType) { case Global: - constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'"); + constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'"); break; case Project: - constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'"); + constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'"); break; case Core: - constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'"); + constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'"); break; } - QString constraint_add = ""; + TQString constraint_add = ""; Profile::EntryList properties = profile->list(Profile::Properties); int i = 0; for (Profile::EntryList::const_iterator it = properties.begin(); it != properties.end(); ++it) - constraint_add += QString::fromLatin1(" %1 '%2' in [X-KDevelop-Properties]"). + constraint_add += TQString::fromLatin1(" %1 '%2' in [X-KDevelop-Properties]"). arg((i++)==0?"":"or").arg((*it).name); if (!constraint_add.isEmpty()) constraint += " and ( " + constraint_add + " ) "; @@ -106,15 +106,15 @@ KTrader::OfferList ProfileEngine::offers(const QString &profileName, OfferType o << " " << constraint << endl << endl << endl;*/ //END debug - KTrader::OfferList list = KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"), constraint); - QStringList names; + KTrader::OfferList list = KTrader::self()->query(TQString::fromLatin1("KDevelop/Plugin"), constraint); + TQStringList names; /* Wrong, this is not what we want to do. Profile::EntryList disableList = profile->list(Profile::ExplicitDisable); KTrader::OfferList::iterator it = list.begin(); while (it != list.end()) { - QString name = (*it)->desktopEntryName(); + TQString name = (*it)->desktopEntryName(); names.append(name); if (profile->hasInEntryList(disableList, name)) { @@ -129,9 +129,9 @@ KTrader::OfferList ProfileEngine::offers(const QString &profileName, OfferType o { if (names.contains((*it).name)) continue; - QString constraint = QString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION); - constraint += QString::fromLatin1("and [Name] == '%1'").arg((*it).name); - KTrader::OfferList enable = KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"), constraint); + TQString constraint = TQString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION); + constraint += TQString::fromLatin1("and [Name] == '%1'").arg((*it).name); + KTrader::OfferList enable = KTrader::self()->query(TQString::fromLatin1("KDevelop/Plugin"), constraint); list += enable; } @@ -149,23 +149,23 @@ KTrader::OfferList ProfileEngine::offers(const QString &profileName, OfferType o KTrader::OfferList ProfileEngine::allOffers(OfferType offerType) { - QString constraint = QString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION); + TQString constraint = TQString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION); switch (offerType) { case Global: - constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'"); + constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'"); break; case Project: - constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'"); + constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'"); break; case Core: - constraint += QString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'"); + constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'"); break; } - return KTrader::self()->query(QString::fromLatin1("KDevelop/Plugin"), constraint); + return KTrader::self()->query(TQString::fromLatin1("KDevelop/Plugin"), constraint); } void ProfileEngine::getProfileWithListing(ProfileListing &listing, Profile **profile, - const QString &profileName) + const TQString &profileName) { if (profileName == "KDevelop") *profile = m_rootProfile; @@ -176,7 +176,7 @@ void ProfileEngine::getProfileWithListing(ProfileListing &listing, Profile **pro } } -KURL::List ProfileEngine::resources(const QString &profileName, const QString &nameFilter) +KURL::List ProfileEngine::resources(const TQString &profileName, const TQString &nameFilter) { ProfileListing listing; Profile *profile = 0; @@ -188,12 +188,12 @@ KURL::List ProfileEngine::resources(const QString &profileName, const QString &n return resources(profile, nameFilter); } -KURL::List ProfileEngine::resources(Profile *profile, const QString &nameFilter) +KURL::List ProfileEngine::resources(Profile *profile, const TQString &nameFilter) { return profile->resources(nameFilter); } -KURL::List ProfileEngine::resourcesRecursive(const QString &profileName, const QString &nameFilter) +KURL::List ProfileEngine::resourcesRecursive(const TQString &profileName, const TQString &nameFilter) { ProfileListing listing; Profile *profile = 0; @@ -207,17 +207,17 @@ KURL::List ProfileEngine::resourcesRecursive(const QString &profileName, const Q return resources; } -void ProfileEngine::diffProfiles(OfferType offerType, const QString &profile1, - const QString &profile2, QStringList &unload, KTrader::OfferList &load) +void ProfileEngine::diffProfiles(OfferType offerType, const TQString &profile1, + const TQString &profile2, TQStringList &unload, KTrader::OfferList &load) { KTrader::OfferList offers1 = offers(profile1, offerType); KTrader::OfferList offers2 = offers(profile2, offerType); - QStringList offers1List; + TQStringList offers1List; for (KTrader::OfferList::const_iterator it = offers1.constBegin(); it != offers1.constEnd(); ++it) offers1List.append((*it)->desktopEntryName()); - QMap<QString, KService::Ptr> offers2List; + TQMap<TQString, KService::Ptr> offers2List; for (KTrader::OfferList::const_iterator it = offers2.constBegin(); it != offers2.constEnd(); ++it) offers2List[(*it)->desktopEntryName()] = *it; @@ -225,7 +225,7 @@ void ProfileEngine::diffProfiles(OfferType offerType, const QString &profile1, // kdDebug() << "OLD PROFILE: " << offers1List << endl; // kdDebug() << "NEW PROFILE: " << offers2List << endl; - for (QStringList::const_iterator it = offers1List.constBegin(); + for (TQStringList::const_iterator it = offers1List.constBegin(); it != offers1List.constEnd(); ++it) { // kdDebug() << "checking: " << *it << endl; @@ -243,7 +243,7 @@ void ProfileEngine::diffProfiles(OfferType offerType, const QString &profile1, load = offers2; } -Profile *ProfileEngine::findProfile(const QString & profileName) +Profile *ProfileEngine::findProfile(const TQString & profileName) { Profile *profile; ProfileListing listing; @@ -251,7 +251,7 @@ Profile *ProfileEngine::findProfile(const QString & profileName) return profile; } -void ProfileEngine::addResource(const QString &profileName, const KURL &url) +void ProfileEngine::addResource(const TQString &profileName, const KURL &url) { ProfileListing listing; Profile *profile = 0; |