summaryrefslogtreecommitdiffstats
path: root/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-12 01:36:19 +0000
commit99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch)
treeeff34cf0762227f6baf2a93e8fef48d4bed2651c /kbabel/kbabeldict/modules/dbsearchengine2/database.cpp
parent1c104292188541106338d4940b0f04beeb4301a0 (diff)
downloadtdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz
tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine2/database.cpp')
-rw-r--r--kbabel/kbabeldict/modules/dbsearchengine2/database.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp
index 0631f7ad..e5250274 100644
--- a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp
+++ b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp
@@ -174,7 +174,7 @@ DataBaseInterface::MainEntry DataBaseInterface::get(const TQString& query,Search
// kdDebug(0) << "MAINDB->GET returned: " << r << endl;
if(counter%5==0) kapp->processEvents(100);
// kdDebug(0) << "events processed" << endl;
- return qMakePair(k,d);
+ return tqMakePair(k,d);
}
@@ -282,7 +282,7 @@ bool DataBaseInterface::addEntry(TQString original,TQString translated,InputInfo
TQStringList wt=words(*otIt);
for(TQStringList::iterator it = wt.begin(); it!=wt.end(); ++it)
{
- if(correlationDiff.contains(*it))
+ if(correlationDiff.tqcontains(*it))
correlationDiff[*it]--;
else
correlationDiff[*it]=-1;
@@ -299,7 +299,7 @@ bool DataBaseInterface::addEntry(TQString original,TQString translated,InputInfo
TQStringList wt=words(*otIt);
for(TQStringList::iterator it = wt.begin(); it!=wt.end(); ++it)
{
- if(correlationDiff.contains(*it))
+ if(correlationDiff.tqcontains(*it))
correlationDiff[*it]++;
else
correlationDiff[*it]=1;
@@ -408,7 +408,7 @@ TQMap<TQString,float> DataBaseInterface::correlation(TQString word,SearchFilter
MainEntry e=get(k->getString(),filter);
TQStringList trad=e.second.getTranslations();
- nocck=words(k->getString()).contains(sword);
+ nocck=words(k->getString()).tqcontains(sword);
for( TQStringList::iterator it2=trad.begin();it2!=trad.end();++it2)
{
@@ -465,7 +465,7 @@ TQStringList DataBaseInterface::words(TQString s)
int pos;
do {
- pos=str.find(TQRegExp("\\s"));
+ pos=str.tqfind(TQRegExp("\\s"));
// if(!simple(str.left(pos)).isEmpty())
// list.append(simple(str.left(pos)));
if(!str.left(pos).isEmpty())
@@ -484,13 +484,13 @@ TQString DataBaseInterface::simple(TQString str,bool ck)
else
res=str.lower(); //lowercase
//FIXME: uncoment the foll. line (check speed)
- res=res.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags
+ res=res.tqreplace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags
//Try to get rid of regexps.
- // res=res.replace(TQRegExp("(('|-|_|\\s|[^\\w%])+)")," "); //strip non-word char
- // res=res.replace(TQRegExp("(('|-|_)+)")," "); //strip non-word char
- // res=res.replace(TQRegExp("[^\\w\\s%]"),""); //strip non-word char
+ // res=res.tqreplace(TQRegExp("(('|-|_|\\s|[^\\w%])+)")," "); //strip non-word char
+ // res=res.tqreplace(TQRegExp("(('|-|_)+)")," "); //strip non-word char
+ // res=res.tqreplace(TQRegExp("[^\\w\\s%]"),""); //strip non-word char
TQString r;
TQChar c;
@@ -607,16 +607,16 @@ TQString DataBaseInterface::format(TQString _s,TQString t)
//FIXME use regexp
TQString s=_s;
- TQString noTagT=t.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3");
- TQChar first=noTagT[noTagT.find(TQRegExp("\\w"))];
+ TQString noTagT=t.tqreplace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3");
+ TQChar first=noTagT[noTagT.tqfind(TQRegExp("\\w"))];
bool firstCapital=isUpper(first);
/*
-bool dotsAtEnd=(t.find("...")+3==t.length());
-bool gtgtAtEnd=(t.find(">>")+2==t.length());
-bool ltltAtEnd=(t.find("<<")==t.length()-2);
+bool dotsAtEnd=(t.tqfind("...")+3==t.length());
+bool gtgtAtEnd=(t.tqfind(">>")+2==t.length());
+bool ltltAtEnd=(t.tqfind("<<")==t.length()-2);
-bool columnAtEnd=(t.find(":")+1==t.length());
+bool columnAtEnd=(t.tqfind(":")+1==t.length());
*/
bool allupper=(t.upper()==t);
@@ -643,13 +643,13 @@ if(columnAtEnd)
if(allupper)
s=s.upper();
- int pos=t.find(TQRegExp("&"));
+ int pos=t.tqfind(TQRegExp("&"));
if(pos>=0) {
- TQChar accel=t[t.find(TQRegExp("&"))+1];
+ TQChar accel=t[t.tqfind(TQRegExp("&"))+1];
if(accel!='&')
{
- pos=s.find(accel,false);
+ pos=s.tqfind(accel,false);
if(pos<0)
pos=0;
s.insert(pos,"&");
@@ -685,8 +685,8 @@ TQString DataBaseInterface::formatRegExp(TQString _s, TQString t, TQString tre,T
//kdDebug(0) << "phRegExp: " << phRegExp << endl;
//kdDebug(0) << "cap[" << i << "]: "<< *capit<< endl;
- stringReplace = stringReplace.replace(TQRegExp(phRegExp),*capit);
- stringSearch = stringSearch.replace(TQRegExp(phRegExp),*capit);
+ stringReplace = stringReplace.tqreplace(TQRegExp(phRegExp),*capit);
+ stringSearch = stringSearch.tqreplace(TQRegExp(phRegExp),*capit);
i++;
}
@@ -694,7 +694,7 @@ TQString DataBaseInterface::formatRegExp(TQString _s, TQString t, TQString tre,T
// kdDebug(0) << "stringReplace " << stringReplace << endl;
TQRegExp stringSearchRegExp = TQRegExp(stringSearch);
// kdDebug(0) << "before: "<<s<<endl;
- s = s.replace(stringSearchRegExp,stringReplace);
+ s = s.tqreplace(stringSearchRegExp,stringReplace);
// kdDebug(0) << "after: "<<s<<endl;
}
@@ -727,7 +727,7 @@ DataBaseInterface::MainEntry DataBaseInterface::getSentence( const TQString & qu
DBItemMainData d;
sentence->get(&k,&d);
if(counter%5==0) kapp->processEvents(100);
- return qMakePair(k,d);
+ return tqMakePair(k,d);
}
@@ -748,5 +748,5 @@ DBItemMultiIndex::IndexList DataBaseInterface::getWordIndex( const TQString & qu
-//#include "database.moc.cpp"
+//#include "database.tqmoc.cpp"