diff options
Diffstat (limited to 'kbabel/kbabeldict/modules/dbsearchengine2')
6 files changed, 33 insertions, 33 deletions
diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp index 36f66fc1..077565d4 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/KDBSearchEngine2.cpp @@ -250,7 +250,7 @@ void KDBSearchEngine2::stringChanged( TQString orig, TQString translated if(!init()) return; //if(translated.isEmpty()) return; InputInfo ii; - if(description.tqfind("fuzzy",false)==-1) + if(description.find("fuzzy",false)==-1) di->addEntry(orig,translated,&ii); } @@ -499,7 +499,7 @@ void KDBSearchEngine2::scanNowPressed() TQString sourceName; sourceName=pw->dbpw->sourceList->currentText(); if(!init()) return; - if(sources.tqcontains(sourceName)) + if(sources.contains(sourceName)) { TQValueList<KURL> urls=sources[sourceName].urls(); PoScanner ps(di); @@ -538,7 +538,7 @@ void KDBSearchEngine2::editSource() TQString sourceName; sourceName=pw->dbpw->sourceList->currentText(); - if(sources.tqcontains(sourceName)) + if(sources.contains(sourceName)) { bool nameIsNew; TQString newName; @@ -554,7 +554,7 @@ void KDBSearchEngine2::editSource() { return; } - nameIsNew=sources.tqcontains(newName); + nameIsNew=sources.contains(newName); if(newName!=sourceName && !nameIsNew) { @@ -602,13 +602,13 @@ void KDBSearchEngine2::addSource() if(sd.exec()==TQDialog::Accepted) { newName= sd.sourceName->text(); - nameIsNew=!sources.tqcontains(newName); + nameIsNew=!sources.contains(newName); } else { return; } - // nameIsNew=sources.tqcontains(newName); + // nameIsNew=sources.contains(newName); if(!nameIsNew) { KMessageBox::error(0,i18n("The name you chose is already used.\nPlease change the source name."), diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp index ab3d14b1..466b68e5 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/algorithms.cpp @@ -145,7 +145,7 @@ DataBaseInterface::ResultList ChunkByChunkSearchAlgorithm::exec( const TQString for(ResultList::iterator it1=r.begin();it1!=r.end() &&!di->stopNow(); ++it1) { TQString chunkTranslation= (*it1).result(); - if(!translationUsed.tqcontains(chunkTranslation)) + if(!translationUsed.contains(chunkTranslation)) { translationUsed[chunkTranslation]=true; kdDebug(0) << "a translation is: " << chunkTranslation << endl; @@ -330,7 +330,7 @@ DataBaseInterface::ResultList FuzzyChunkSearchAlgorithm::exec( const TQString & TQString re=di->format(di->simple(*it,true),query); QueryResult r(re,ori,score); for(TQPtrListIterator<AbstractChunk> it(querychunks); it.current() && di->stopNow() ; ++it){ - ori=ori.tqreplace(TQRegExp((*it)->chunkString(),false),"<font color=#000080><u><b>"+(*it)->chunkString()+"</b></u></font>"); + ori=ori.replace(TQRegExp((*it)->chunkString(),false),"<font color=#000080><u><b>"+(*it)->chunkString()+"</b></u></font>"); } r.setRichOriginal(ori); if(!di->stopNow()) diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp index e5250274..1fe02198 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/database.cpp @@ -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.tqcontains(*it)) + if(correlationDiff.contains(*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.tqcontains(*it)) + if(correlationDiff.contains(*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()).tqcontains(sword); + nocck=words(k->getString()).contains(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.tqfind(TQRegExp("\\s")); + pos=str.find(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.tqreplace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags + res=res.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); //remove enclosing tags //Try to get rid of regexps. - // 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 + // 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 TQString r; TQChar c; @@ -607,16 +607,16 @@ TQString DataBaseInterface::format(TQString _s,TQString t) //FIXME use regexp TQString s=_s; - TQString noTagT=t.tqreplace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); - TQChar first=noTagT[noTagT.tqfind(TQRegExp("\\w"))]; + TQString noTagT=t.replace(TQRegExp("(<(.*)>)(.*)(</\\2>)"),"\\3"); + TQChar first=noTagT[noTagT.find(TQRegExp("\\w"))]; bool firstCapital=isUpper(first); /* -bool dotsAtEnd=(t.tqfind("...")+3==t.length()); -bool gtgtAtEnd=(t.tqfind(">>")+2==t.length()); -bool ltltAtEnd=(t.tqfind("<<")==t.length()-2); +bool dotsAtEnd=(t.find("...")+3==t.length()); +bool gtgtAtEnd=(t.find(">>")+2==t.length()); +bool ltltAtEnd=(t.find("<<")==t.length()-2); -bool columnAtEnd=(t.tqfind(":")+1==t.length()); +bool columnAtEnd=(t.find(":")+1==t.length()); */ bool allupper=(t.upper()==t); @@ -643,13 +643,13 @@ if(columnAtEnd) if(allupper) s=s.upper(); - int pos=t.tqfind(TQRegExp("&")); + int pos=t.find(TQRegExp("&")); if(pos>=0) { - TQChar accel=t[t.tqfind(TQRegExp("&"))+1]; + TQChar accel=t[t.find(TQRegExp("&"))+1]; if(accel!='&') { - pos=s.tqfind(accel,false); + pos=s.find(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.tqreplace(TQRegExp(phRegExp),*capit); - stringSearch = stringSearch.tqreplace(TQRegExp(phRegExp),*capit); + stringReplace = stringReplace.replace(TQRegExp(phRegExp),*capit); + stringSearch = stringSearch.replace(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.tqreplace(stringSearchRegExp,stringReplace); + s = s.replace(stringSearchRegExp,stringReplace); // kdDebug(0) << "after: "<<s<<endl; } diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp index 0958b801..2b4d7360 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbentries.cpp @@ -77,7 +77,7 @@ void DBItemMainData::write(TQDataStream *s) void DBItemMainData::addTranslation(TQString str, unsigned int ref) { //get(); - if(translations[str].tqfind(ref)==translations[str].end()) // If it do not exists + if(translations[str].find(ref)==translations[str].end()) // If it do not exists translations[str].append(ref); //add a new reference. else { @@ -106,7 +106,7 @@ TQMapIterator<TQString,TQValueList<unsigned int> > it2; { //Dirty hack it2=it; it++; - if(it2.data().tqfind(ref)!=it2.data().end()) + if(it2.data().find(ref)!=it2.data().end()) removeTranslation(it2.key(),ref); } @@ -142,7 +142,7 @@ list.clear(); void DBItemMultiIndex::addEntry(unsigned int index) { // get(); - if(list.tqfind(index)==list.end()) + if(list.find(index)==list.end()) { list.append(index); qHeapSort(list); diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp b/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp index b7e64c2b..96239ba9 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbscan.cpp @@ -203,7 +203,7 @@ emit fileStarted(); Catalog * catalog=new Catalog(this,"ScanPoCatalog"); TQString pretty=u.prettyURL(); -TQString location=pretty.right(pretty.length()-pretty.tqfindRev("/")-1); +TQString location=pretty.right(pretty.length()-pretty.findRev("/")-1); connect(catalog,TQT_SIGNAL(signalProgress(int)),this,TQT_SIGNAL(fileLoading(int))); emit filename(location); diff --git a/kbabel/kbabeldict/modules/dbsearchengine2/dbseprefwidget.ui b/kbabel/kbabeldict/modules/dbsearchengine2/dbseprefwidget.ui index fe3b1f6f..64a74b8a 100644 --- a/kbabel/kbabeldict/modules/dbsearchengine2/dbseprefwidget.ui +++ b/kbabel/kbabeldict/modules/dbsearchengine2/dbseprefwidget.ui @@ -288,7 +288,7 @@ It also substitutes groups of more than one space character with only one space <cstring>containsCB</cstring> </property> <property name="text"> - <string>Query tqcontains</string> + <string>Query contains</string> </property> <property name="whatsThis" stdset="0"> <string>Match if query contains the database string</string> |