From 98d15d90b6a83e2df32d678013847e18b8a8c7e8 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 28 May 2011 18:03:09 +0000 Subject: TQt4 port Katapult This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/katapult@1233929 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- katapult/common/cachedcatalog.cpp | 40 +++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) (limited to 'katapult/common/cachedcatalog.cpp') diff --git a/katapult/common/cachedcatalog.cpp b/katapult/common/cachedcatalog.cpp index bf34b87..19c15a9 100644 --- a/katapult/common/cachedcatalog.cpp +++ b/katapult/common/cachedcatalog.cpp @@ -20,8 +20,8 @@ #include "cachedcatalog.moc" -#include -#include +#include +#include #include "cachedcatalog.h" #include "katapultitem.h" @@ -46,7 +46,7 @@ unsigned int CachedCatalog::minQueryLen() const void CachedCatalog::queryChanged() { - int newStatus = 0; + int newtqStatus = 0; if(query() == "") { results.clear(); @@ -58,7 +58,7 @@ void CachedCatalog::queryChanged() if(status() & S_Active) { - QPtrListIterator it(results); + TQPtrListIterator it(results); KatapultItem *item; while((item = it.current())!=0) @@ -73,7 +73,7 @@ void CachedCatalog::queryChanged() } else { results.clear(); - QPtrListIterator it(cache); + TQPtrListIterator it(cache); KatapultItem *item; while((item=it.current())!=0) { @@ -87,36 +87,36 @@ void CachedCatalog::queryChanged() } } - newStatus |= S_Active; + newtqStatus |= S_Active; if(results.count() > 0) { - newStatus |= S_HasResults; + newtqStatus |= S_HasResults; if(results.count() > 1) - newStatus |= S_Multiple; + newtqStatus |= S_Multiple; } else - newStatus |= S_NoResults; + newtqStatus |= S_NoResults; setBestMatch(newBestMatch); } } - setStatus(newStatus); + settqStatus(newtqStatus); } -Match CachedCatalog::queryItem(const KatapultItem *item, QString query) const +Match CachedCatalog::queryItem(const KatapultItem *item, TQString query) const { int wordNo = 0; int _rank = 0; unsigned int _matched = 0; - QString text = item->text().lower(); - QStringList queryWords = QStringList::split(" ", query.lower()); + TQString text = item->text().lower(); + TQStringList queryWords = TQStringList::split(" ", query.lower()); int wordMax = queryWords.count()-1; - QStringList words = QStringList::split(" ", text); - QStringList::Iterator wit = words.begin(); - for(QStringList::Iterator qit = queryWords.begin(); qit != queryWords.end(); ++qit) { - QString queryWord = *qit; + TQStringList words = TQStringList::split(" ", text); + TQStringList::Iterator wit = words.begin(); + for(TQStringList::Iterator qit = queryWords.begin(); qit != queryWords.end(); ++qit) { + TQString queryWord = *qit; bool didMatch = FALSE; for(; wit != words.end(); ++wit) { - QString word = *wit; + TQString word = *wit; if(word.startsWith(queryWord)) { if(_matched != 0) _matched++; @@ -151,11 +151,11 @@ Match CachedCatalog::queryItem(const KatapultItem *item, QString query) const return Match(item, _rank, _matched); } -const KatapultItem * CachedCatalog::findExact(QString text) const +const KatapultItem * CachedCatalog::findExact(TQString text) const { text = text.lower(); KatapultItem *item; - QPtrListIterator it(cache); + TQPtrListIterator it(cache); while((item=it.current())!=0) { ++it; -- cgit v1.2.3