summaryrefslogtreecommitdiffstats
path: root/src/profileengine/lib
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-14 16:45:05 +0000
commit48d4a26399959121f33d2bc3bfe51c7827b654fc (patch)
tree5ae5e6e00d3ba330b7b8be9bc097154b6bc739e8 /src/profileengine/lib
parent7e701ace6592d09e1f2c0cf28c7d6d872d78f4f5 (diff)
downloadtdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.tar.gz
tdevelop-48d4a26399959121f33d2bc3bfe51c7827b654fc.zip
TQt4 port kdevelop
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdevelop@1236710 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/profileengine/lib')
-rw-r--r--src/profileengine/lib/profile.cpp26
-rw-r--r--src/profileengine/lib/profile.h10
-rw-r--r--src/profileengine/lib/profileengine.cpp36
-rw-r--r--src/profileengine/lib/profileengine.h24
4 files changed, 48 insertions, 48 deletions
diff --git a/src/profileengine/lib/profile.cpp b/src/profileengine/lib/profile.cpp
index f07c6376..39d247bf 100644
--- a/src/profileengine/lib/profile.cpp
+++ b/src/profileengine/lib/profile.cpp
@@ -26,8 +26,8 @@
#include <kconfig.h>
#include <kio/netaccess.h>
-Profile::Profile(Profile *parent, const TQString &name)
- :m_parent(parent), m_name(name)
+Profile::Profile(Profile *tqparent, const TQString &name)
+ :m_parent(tqparent), m_name(name)
{
if (m_parent)
m_parent->addChildProfile(this);
@@ -49,8 +49,8 @@ Profile::Profile(Profile *parent, const TQString &name)
m_explicitDisable = config.readListEntry("List");
}
-Profile::Profile(Profile *parent, const TQString &name, const TQString &genericName, const TQString &description)
- :m_parent(parent), m_name(name), m_genericName(genericName), m_description(description)
+Profile::Profile(Profile *tqparent, const TQString &name, const TQString &genericName, const TQString &description)
+ :m_parent(tqparent), m_name(name), m_genericName(genericName), m_description(description)
{
if (m_parent)
m_parent->addChildProfile(this);
@@ -59,18 +59,18 @@ Profile::Profile(Profile *parent, const TQString &name, const TQString &genericN
Profile::~Profile()
{
- for (TQValueList<Profile*>::iterator it = m_children.begin(); it != m_children.end(); ++it)
+ for (TQValueList<Profile*>::iterator it = m_tqchildren.begin(); it != m_tqchildren.end(); ++it)
delete *it;
}
void Profile::addChildProfile(Profile *profile)
{
- m_children.append(profile);
+ m_tqchildren.append(profile);
}
void Profile::removeChildProfile(Profile *profile)
{
- m_children.remove(profile);
+ m_tqchildren.remove(profile);
}
TQString Profile::dirName() const
@@ -104,10 +104,10 @@ void Profile::save()
Profile::EntryList Profile::list(List type)
{
- EntryList parentList;
+ EntryList tqparentList;
if (m_parent)
- parentList = m_parent->list(type);
- EntryList list = parentList;
+ tqparentList = m_parent->list(type);
+ EntryList list = tqparentList;
for (EntryList::iterator it = list.begin(); it != list.end(); ++it)
(*it).derived = true;
TQStringList &personalList = listByType(type);
@@ -119,7 +119,7 @@ Profile::EntryList Profile::list(List type)
void Profile::addEntry(List type, const TQString &value)
{
TQStringList &list = listByType(type);
- if (!list.contains(value))
+ if (!list.tqcontains(value))
list.append(value);
}
@@ -187,10 +187,10 @@ KURL::List Profile::resources(const TQString &nameFilter)
dir = dir + "kdevelop/profiles" + dirName();
TQDir d(dir);
- const QFileInfoList *infoList = d.entryInfoList(nameFilter, TQDir::Files);
+ const TQFileInfoList *infoList = d.entryInfoList(nameFilter, TQDir::Files);
if (!infoList)
continue;
- for (QFileInfoList::const_iterator infoIt = infoList->constBegin();
+ for (TQFileInfoList::const_iterator infoIt = infoList->constBegin();
infoIt != infoList->constEnd(); ++ infoIt)
resources.append((*infoIt)->absFilePath());
}
diff --git a/src/profileengine/lib/profile.h b/src/profileengine/lib/profile.h
index c81db7e3..30e00517 100644
--- a/src/profileengine/lib/profile.h
+++ b/src/profileengine/lib/profile.h
@@ -45,12 +45,12 @@ public:
ExplicitDisable /**<A list of explicitly disabled plugins (names).*/
};
- Profile(Profile *parent, const TQString &name);
- Profile(Profile *parent, const TQString &name, const TQString &genericName, const TQString &description);
+ Profile(Profile *tqparent, const TQString &name);
+ Profile(Profile *tqparent, const TQString &name, const TQString &genericName, const TQString &description);
~Profile();
- TQValueList<Profile*> children() const { return m_children; }
- Profile *parent() const { return m_parent; }
+ TQValueList<Profile*> tqchildren() const { return m_tqchildren; }
+ Profile *tqparent() const { return m_parent; }
void save();
bool remove();
@@ -81,7 +81,7 @@ protected:
private:
Profile *m_parent;
- TQValueList<Profile*> m_children;
+ TQValueList<Profile*> m_tqchildren;
TQString m_name;
diff --git a/src/profileengine/lib/profileengine.cpp b/src/profileengine/lib/profileengine.cpp
index af8f2afe..7a6d65d8 100644
--- a/src/profileengine/lib/profileengine.cpp
+++ b/src/profileengine/lib/profileengine.cpp
@@ -57,7 +57,7 @@ void ProfileEngine::processDir(const TQString &dir, const TQString &currPath, TQ
{
TQString dirName = *eit;
Profile *profile = 0;
- if (passedPaths.contains(currPath + dirName))
+ if (passedPaths.tqcontains(currPath + dirName))
profile = passedPaths[currPath + dirName];
else
{
@@ -78,24 +78,24 @@ KTrader::OfferList ProfileEngine::offers(const TQString &profileName, OfferType
if (!profile)
return KTrader::OfferList();
- TQString constraint = TQString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION);
+ TQString constraint = TQString::tqfromLatin1("[X-KDevelop-Version] == %1").tqarg(KDEVELOP_PLUGIN_VERSION);
switch (offerType) {
case Global:
- constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'");
+ constraint += TQString::tqfromLatin1(" and [X-KDevelop-Scope] == 'Global'");
break;
case Project:
- constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'");
+ constraint += TQString::tqfromLatin1(" and [X-KDevelop-Scope] == 'Project'");
break;
case Core:
- constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'");
+ constraint += TQString::tqfromLatin1(" and [X-KDevelop-Scope] == 'Core'");
break;
}
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 += TQString::fromLatin1(" %1 '%2' in [X-KDevelop-Properties]").
- arg((i++)==0?"":"or").arg((*it).name);
+ constraint_add += TQString::tqfromLatin1(" %1 '%2' in [X-KDevelop-Properties]").
+ tqarg((i++)==0?"":"or").tqarg((*it).name);
if (!constraint_add.isEmpty())
constraint += " and ( " + constraint_add + " ) ";
@@ -106,7 +106,7 @@ KTrader::OfferList ProfileEngine::offers(const TQString &profileName, OfferType
<< " " << constraint << endl << endl << endl;*/
//END debug
- KTrader::OfferList list = KTrader::self()->query(TQString::fromLatin1("KDevelop/Plugin"), constraint);
+ KTrader::OfferList list = KTrader::self()->query(TQString::tqfromLatin1("KDevelop/Plugin"), constraint);
TQStringList names;
/* Wrong, this is not what we want to do.
@@ -127,11 +127,11 @@ KTrader::OfferList ProfileEngine::offers(const TQString &profileName, OfferType
Profile::EntryList enableList = profile->list(Profile::ExplicitEnable);
for (Profile::EntryList::const_iterator it = enableList.begin(); it != enableList.end(); ++it)
{
- if (names.contains((*it).name))
+ if (names.tqcontains((*it).name))
continue;
- 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);
+ TQString constraint = TQString::tqfromLatin1("[X-KDevelop-Version] == %1").tqarg(KDEVELOP_PLUGIN_VERSION);
+ constraint += TQString::tqfromLatin1("and [Name] == '%1'").tqarg((*it).name);
+ KTrader::OfferList enable = KTrader::self()->query(TQString::tqfromLatin1("KDevelop/Plugin"), constraint);
list += enable;
}
@@ -149,19 +149,19 @@ KTrader::OfferList ProfileEngine::offers(const TQString &profileName, OfferType
KTrader::OfferList ProfileEngine::allOffers(OfferType offerType)
{
- TQString constraint = TQString::fromLatin1("[X-KDevelop-Version] == %1").arg(KDEVELOP_PLUGIN_VERSION);
+ TQString constraint = TQString::tqfromLatin1("[X-KDevelop-Version] == %1").tqarg(KDEVELOP_PLUGIN_VERSION);
switch (offerType) {
case Global:
- constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Global'");
+ constraint += TQString::tqfromLatin1(" and [X-KDevelop-Scope] == 'Global'");
break;
case Project:
- constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Project'");
+ constraint += TQString::tqfromLatin1(" and [X-KDevelop-Scope] == 'Project'");
break;
case Core:
- constraint += TQString::fromLatin1(" and [X-KDevelop-Scope] == 'Core'");
+ constraint += TQString::tqfromLatin1(" and [X-KDevelop-Scope] == 'Core'");
break;
}
- return KTrader::self()->query(TQString::fromLatin1("KDevelop/Plugin"), constraint);
+ return KTrader::self()->query(TQString::tqfromLatin1("KDevelop/Plugin"), constraint);
}
void ProfileEngine::getProfileWithListing(ProfileListing &listing, Profile **profile,
@@ -229,7 +229,7 @@ void ProfileEngine::diffProfiles(OfferType offerType, const TQString &profile1,
it != offers1List.constEnd(); ++it)
{
// kdDebug() << "checking: " << *it << endl;
- if (offers2List.contains(*it))
+ if (offers2List.tqcontains(*it))
{
// kdDebug() << " keep" << endl;
offers2.remove(offers2List[*it]);
diff --git a/src/profileengine/lib/profileengine.h b/src/profileengine/lib/profileengine.h
index e790dece..9184df62 100644
--- a/src/profileengine/lib/profileengine.h
+++ b/src/profileengine/lib/profileengine.h
@@ -177,8 +177,8 @@ public:
template<class Operation>
void walkProfiles(Operation &op, Profile *root)
{
- TQValueList<Profile*> children = root->children();
- for (TQValueList<Profile*>::iterator it = children.begin(); it != children.end(); ++it)
+ TQValueList<Profile*> tqchildren = root->tqchildren();
+ for (TQValueList<Profile*>::iterator it = tqchildren.begin(); it != tqchildren.end(); ++it)
{
op(*it);
walkProfiles<Operation>(op, *it);
@@ -189,7 +189,7 @@ public:
but the operation in this case returns a result of type defined by
"Result" template parameter.
- When iterating the tree, the result of operation applied to the parent profile
+ When iterating the tree, the result of operation applied to the tqparent profile
is passed as @p result parameter to the recursive call for child profiles.
For example, this function can be used to build another hierarcy of profiles
@@ -199,24 +199,24 @@ public:
@code
class ProfileListBuilding {
public:
- ProfileItem * operator() (ProfileItem *parent, Profile *profile)
+ ProfileItem * operator() (ProfileItem *tqparent, Profile *profile)
{
- parent->setOpen(true);
- return new ProfileItem(parent, profile);
+ tqparent->setOpen(true);
+ return new ProfileItem(tqparent, profile);
}
};
class ProfileItem: public KListViewItem {
public:
- ProfileItem(KListView *parent, Profile *profile)
- :KListViewItem(parent), m_profile(profile)
+ ProfileItem(KListView *tqparent, Profile *profile)
+ :KListViewItem(tqparent), m_profile(profile)
{
setText(0, profile->genericName());
setText(1, profile->description());
}
- ProfileItem(KListViewItem *parent, Profile *profile)
- : KListViewItem(parent), m_profile(profile)
+ ProfileItem(KListViewItem *tqparent, Profile *profile)
+ : KListViewItem(tqparent), m_profile(profile)
{
setText(0, profile->genericName());
setText(1, profile->description());
@@ -244,8 +244,8 @@ public:
template<class Operation, class Result>
void walkProfiles(Operation &op, Result *result, Profile *root)
{
- TQValueList<Profile*> children = root->children();
- for (TQValueList<Profile*>::iterator it = children.begin(); it != children.end(); ++it)
+ TQValueList<Profile*> tqchildren = root->tqchildren();
+ for (TQValueList<Profile*>::iterator it = tqchildren.begin(); it != tqchildren.end(); ++it)
{
Result *newResult = op(result, *it);
walkProfiles<Operation>(op, newResult, *it);