summaryrefslogtreecommitdiffstats
path: root/kbabel/common/catalog.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit0813b39aed2cf4c84157a22c4c9594336d93d412 (patch)
tree0f6157f9c9ecc6ed26cb98f058219a8021d3f4a6 /kbabel/common/catalog.cpp
parent35dc58791106d7a1864264063df5f3ee3f1f0f15 (diff)
downloadtdesdk-0813b39aed2cf4c84157a22c4c9594336d93d412.tar.gz
tdesdk-0813b39aed2cf4c84157a22c4c9594336d93d412.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/common/catalog.cpp')
-rw-r--r--kbabel/common/catalog.cpp208
1 files changed, 104 insertions, 104 deletions
diff --git a/kbabel/common/catalog.cpp b/kbabel/common/catalog.cpp
index 6ca18cba..3d9de8b2 100644
--- a/kbabel/common/catalog.cpp
+++ b/kbabel/common/catalog.cpp
@@ -165,7 +165,7 @@ int Catalog::indexForMsgid(const TQString& id) const
int i=0;
TQValueVector<CatalogItem>::ConstIterator it = d->_entries.begin();
- while(it != d->_entries.end() && !((*it).msgid(true).tqcontains(id)))
+ while(it != d->_entries.end() && !((*it).msgid(true).contains(id)))
{
++it;
i++;
@@ -290,8 +290,8 @@ bool Catalog::setHeader(CatalogItem newHeader)
{
// normalize the values - ensure every key:value pair is only on a single line
TQString values = newHeader.msgstr().first();
- values.tqreplace ("\n", "");
- values.tqreplace ("\\n", "\\n\n");
+ values.replace ("\n", "");
+ values.replace ("\\n", "\\n\n");
kdDebug () << "Normalized header: " << values << endl;
@@ -343,7 +343,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
temp+="\\n";
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *Last-Translator:.*")))
+ if((*it).contains(TQRegExp("^ *Last-Translator:.*")))
{
(*it) = temp;
found=true;
@@ -363,7 +363,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *PO-Revision-Date:.*")))
+ if((*it).contains(TQRegExp("^ *PO-Revision-Date:.*")))
{
(*it) = temp;
found=true;
@@ -380,11 +380,11 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
found=false;
temp="Project-Id-Version: "+saveOptions.projectString+"\\n";
- temp.tqreplace( "@PACKAGE@", packageName());
+ temp.replace( "@PACKAGE@", packageName());
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *Project-Id-Version:.*")))
+ if((*it).contains(TQRegExp("^ *Project-Id-Version:.*")))
{
(*it) = temp;
found=true;
@@ -408,7 +408,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
temp+="\\n";
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *Language-Team:.*")))
+ if((*it).contains(TQRegExp("^ *Language-Team:.*")))
{
(*it) = temp;
found=true;
@@ -440,7 +440,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
it = headerList.begin();
while( it != headerList.end() )
{
- if( (*it).tqfind( TQRegExp( "^ *Content-Type:.*" ) ) != -1 )
+ if( (*it).find( TQRegExp( "^ *Content-Type:.*" ) ) != -1 )
{
if ( found )
{
@@ -483,7 +483,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *Content-Transfer-Encoding:.*")))
+ if((*it).contains(TQRegExp("^ *Content-Transfer-Encoding:.*")))
{
(*it) = temp;
found=true;
@@ -502,7 +502,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *X-Generator:.*")))
+ if((*it).contains(TQRegExp("^ *X-Generator:.*")))
{
(*it) = temp;
found=true;
@@ -519,7 +519,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
found=false;
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *MIME-Version:")))
+ if((*it).contains(TQRegExp("^ *MIME-Version:")))
{
(*it) = temp;
found=true;
@@ -541,7 +541,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
{
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).tqcontains(TQRegExp("^ *Plural-Forms:")))
+ if((*it).contains(TQRegExp("^ *Plural-Forms:")))
{
(*it) = temp;
found=true;
@@ -564,7 +564,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
for( it = commentList.begin(); it != commentList.end(); ++it )
{
// U+00A9 is the Copyright sign
- if ( (*it).tqfind( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9).*Free Software Foundation, Inc") ) != -1 )
+ if ( (*it).find( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9).*Free Software Foundation, Inc") ) != -1 )
{
found=true;
break;
@@ -572,21 +572,21 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
}
if(found)
{
- if ( (*it).tqfind( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9) YEAR Free Software Foundation, Inc\\.") ) != -1 )
+ if ( (*it).find( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9) YEAR Free Software Foundation, Inc\\.") ) != -1 )
{
//template string
if( saveOptions.FSFCopyright == ProjectSettingsBase::Remove)
(*it).remove(" YEAR Free Software Foundation, Inc");
else
- (*it).tqreplace("YEAR", TQDate::tqcurrentDate().toString("yyyy"));
+ (*it).replace("YEAR", TQDate::tqcurrentDate().toString("yyyy"));
} else
if( saveOptions.FSFCopyright == ProjectSettingsBase::Update )
{
//update years
TQString cy = TQDate::tqcurrentDate().toString("yyyy");
- if( !(*it).tqcontains( TQRegExp(cy)) ) // is the year already included?
+ if( !(*it).contains( TQRegExp(cy)) ) // is the year already included?
{
- int index = (*it).tqfindRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
+ int index = (*it).findRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
if( index == -1 )
{
KMessageBox::information(0,i18n("Free Software Foundation Copyright does not contain any year. "
@@ -603,14 +603,14 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
&& ( !saveOptions.descriptionString.isEmpty() ) )
{
temp = "# "+saveOptions.descriptionString;
- temp.tqreplace( "@PACKAGE@", packageName());
- temp.tqreplace( "@LANGUAGE@", identityOptions.languageName);
+ temp.replace( "@PACKAGE@", packageName());
+ temp.replace( "@LANGUAGE@", identityOptions.languageName);
temp = temp.stripWhiteSpace();
// The description strings has often buggy variants already in the file, these must be removed
TQString regexpstr = "^#\\s+" + TQRegExp::escape( saveOptions.descriptionString.stripWhiteSpace() ) + "\\s*$";
- regexpstr.tqreplace( "@PACKAGE@", ".*" );
- regexpstr.tqreplace( "@LANGUAGE@", ".*" );
+ regexpstr.replace( "@PACKAGE@", ".*" );
+ regexpstr.replace( "@LANGUAGE@", ".*" );
//kdDebug() << "REGEXPSTR: " << regexpstr << endl;
TQRegExp regexp ( regexpstr );
@@ -683,11 +683,11 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
while ( it != commentList.end() )
{
bool deleteItem = false;
- if ( (*it).tqfind ( "copyright", 0, false ) != -1 )
+ if ( (*it).find ( "copyright", 0, false ) != -1 )
{
// We have a line with a copyright. It should not be moved.
}
- else if ( (*it).tqfind ( regexpYearAlone ) != -1 )
+ else if ( (*it).find ( regexpYearAlone ) != -1 )
{
// We have found a year number that is preceeded by a comma.
// That is typical of KBabel 1.10 (and earlier?) when there is neither an author name nor an email
@@ -699,9 +699,9 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
// Typical placeholder, remove it.
deleteItem = true;
}
- else if ( (*it).tqfind ( regexpAuthorYear ) != -1 ) // email address followed by year
+ else if ( (*it).find ( regexpAuthorYear ) != -1 ) // email address followed by year
{
- if ( foundAuthors.tqfind( (*it) ) == foundAuthors.end() )
+ if ( foundAuthors.find( (*it) ) == foundAuthors.end() )
{
// The author line is new (and not a duplicate), so add it to the author line list
foundAuthors.append( (*it) );
@@ -726,12 +726,12 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
ait = foundAuthors.end();
for( it = foundAuthors.begin() ; it!=foundAuthors.end(); ++it )
{
- if ( (*it).tqfind( TQRegExp(
+ if ( (*it).find( TQRegExp(
TQRegExp::escape( identityOptions.authorName )+".*"
+ TQRegExp::escape( identityOptions.authorEmail ) ) ) != -1 )
{
foundAuthor = true;
- if( (*it).tqfind( cy ) != -1 )
+ if( (*it).find( cy ) != -1 )
found = true;
else
ait = it;
@@ -744,7 +744,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
else if ( ait != foundAuthors.end() )
{
//update years
- const int index = (*ait).tqfindRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
+ const int index = (*ait).findRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
if ( index == -1 )
(*ait)+=", "+cy;
else
@@ -760,7 +760,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
it=commentList.end();
do
--it;
- while( ( it != commentList.begin() ) && ( (*it).tqfind( TQRegExp( "^#(\\s*$|[:,\\.])" ) ) == -1 ) );
+ while( ( it != commentList.begin() ) && ( (*it).find( TQRegExp( "^#(\\s*$|[:,\\.])" ) ) == -1 ) );
++it;
for( ait = foundAuthors.begin() ; ait != foundAuthors.end() ; ++ait )
{
@@ -838,7 +838,7 @@ TQString Catalog::packageName() const
TQString package=d->_url.fileName();
- int index=package.tqfind(TQRegExp("(\\."+identitySettings().languageCode+")?\\.pot?$"));
+ int index=package.find(TQRegExp("(\\."+identitySettings().languageCode+")?\\.pot?$"));
if(index>0)
package=package.left(index);
@@ -848,7 +848,7 @@ TQString Catalog::packageName() const
void Catalog::setPackage(const TQString& package )
{
- const int pos = package.tqfindRev( '/' );
+ const int pos = package.findRev( '/' );
if( pos < 0 )
{
d->_packageDir = TQString();
@@ -1095,7 +1095,7 @@ ConversiontqStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, co
Msgfmt::tqStatus Catalog::checkSyntax(TQString& output, bool clearErrors)
{
- if( !d->_mimeTypes.tqcontains( "application/x-gettext" ) )
+ if( !d->_mimeTypes.contains( "application/x-gettext" ) )
return Msgfmt::Unsupported;
TQString filename;
@@ -1128,10 +1128,10 @@ Msgfmt::tqStatus Catalog::checkSyntax(TQString& output, bool clearErrors)
const TQStringList lines = TQStringList::split("\n",output);
for ( TQStringList::const_iterator it = lines.constBegin(); it != lines.constEnd(); ++it )
{
- if( (*it).tqfind(TQRegExp("^.+:\\d+:")) >= 0 )
+ if( (*it).find(TQRegExp("^.+:\\d+:")) >= 0 )
{
- const int begin=(*it).tqfind(":",0)+1;
- const int end=(*it).tqfind(":",begin);
+ const int begin=(*it).find(":",0)+1;
+ const int end=(*it).find(":",begin);
const TQString line=(*it).mid(begin,end-begin);
@@ -1148,7 +1148,7 @@ Msgfmt::tqStatus Catalog::checkSyntax(TQString& output, bool clearErrors)
continue;
}
- if( !d->_errorIndex.tqcontains(currentIndex) )
+ if( !d->_errorIndex.contains(currentIndex) )
{
d->_errorIndex.append(currentIndex);
d->_entries[currentIndex].setSyntaxError(true);
@@ -1177,7 +1177,7 @@ void Catalog::clearErrorList()
void Catalog::removeFromErrorList(uint index)
{
- if(d->_errorIndex.tqcontains(index))
+ if(d->_errorIndex.contains(index))
{
d->_errorIndex.remove(index);
d->_entries[index].setSyntaxError(false);
@@ -1241,7 +1241,7 @@ bool Catalog::checkUsingTool(KDataTool* tool, bool clearErrors)
{
if( !tool->run( "validate", (void*)(&(*it)), "CatalogItem", "application/x-kbabel-catalogitem" ))
{
- if( !d->_errorIndex.tqcontains(index) )
+ if( !d->_errorIndex.contains(index) )
{
d->_errorIndex.append(index);
hasErrors=true;
@@ -1461,7 +1461,7 @@ bool Catalog::isUntranslated(uint index) const
bool Catalog::hasError(uint index, DocPosition& pos) const
{
- if( d->_errorIndex.tqcontains(index) )
+ if( d->_errorIndex.contains(index) )
{
pos.item=index;
pos.form=0;
@@ -1541,7 +1541,7 @@ int Catalog::prevError(uint startIndex, DocPosition& pos) const
void Catalog::registerView(CatalogView* view)
{
- if(d->_views.tqcontainsRef(view)==0)
+ if(d->_views.containsRef(view)==0)
{
d->_views.append(view);
}
@@ -1734,7 +1734,7 @@ int Catalog::findNextInList(const TQValueList<uint>& list,uint index) const
int nextIndex=-1;
// find index in List
- it=list.tqfind(index);
+ it=list.find(index);
// if the given index is found in the list and not the last entry
// in the list, return the next listentry
@@ -1765,7 +1765,7 @@ int Catalog::findPrevInList(const TQValueList<uint>& list,uint index) const
int prevIndex=-1;
- it=list.tqfind(index);
+ it=list.find(index);
// if the given index is found in the list and not the last entry
// in the list, return the next listentry
@@ -1831,49 +1831,49 @@ TQString Catalog::dateTime() const
const TQTime time = dt.time();
// the year
- dateTimeString.tqreplace( "%Y", TQString::number( date.year() ) );
- dateTimeString.tqreplace( "%y", TQString::number( date.year() ).right(2) );
+ dateTimeString.replace( "%Y", TQString::number( date.year() ) );
+ dateTimeString.replace( "%y", TQString::number( date.year() ).right(2) );
// the month
if(date.month()<10)
{
- dateTimeString.tqreplace( "%m", "0"+TQString::number( date.month() ) );
+ dateTimeString.replace( "%m", "0"+TQString::number( date.month() ) );
}
else
{
- dateTimeString.tqreplace( "%m", TQString::number( date.month() ) );
+ dateTimeString.replace( "%m", TQString::number( date.month() ) );
}
- dateTimeString.tqreplace( "%f", TQString::number( date.month() ) );
+ dateTimeString.replace( "%f", TQString::number( date.month() ) );
- dateTimeString.tqreplace( "%b", date.longMonthName(date.month()) );
- dateTimeString.tqreplace( "%h", date.longMonthName(date.month()) );
+ dateTimeString.replace( "%b", date.longMonthName(date.month()) );
+ dateTimeString.replace( "%h", date.longMonthName(date.month()) );
// the day
- dateTimeString.tqreplace( "%j", TQString::number( date.dayOfYear() ) );
- dateTimeString.tqreplace( "%e", TQString::number( date.day() ) );
+ dateTimeString.replace( "%j", TQString::number( date.dayOfYear() ) );
+ dateTimeString.replace( "%e", TQString::number( date.day() ) );
if(date.day() < 10)
{
- dateTimeString.tqreplace( "%d", "0"+TQString::number( date.day() ) );
+ dateTimeString.replace( "%d", "0"+TQString::number( date.day() ) );
}
else
{
- dateTimeString.tqreplace( "%d", TQString::number( date.day() ) );
+ dateTimeString.replace( "%d", TQString::number( date.day() ) );
}
- dateTimeString.tqreplace( "%a", date.longDayName( date.dayOfWeek() ) );
+ dateTimeString.replace( "%a", date.longDayName( date.dayOfWeek() ) );
// hour
- dateTimeString.tqreplace( "%k", TQString::number( time.hour() ) );
+ dateTimeString.replace( "%k", TQString::number( time.hour() ) );
if(time.hour() < 10)
{
- dateTimeString.tqreplace( "%H", "0"+TQString::number( time.hour() ) );
+ dateTimeString.replace( "%H", "0"+TQString::number( time.hour() ) );
}
else
{
- dateTimeString.tqreplace( "%H", TQString::number( time.hour() ) );
+ dateTimeString.replace( "%H", TQString::number( time.hour() ) );
}
TQString zone; // AM or PM
@@ -1888,46 +1888,46 @@ TQString Catalog::dateTime() const
zone="AM";
}
- dateTimeString.tqreplace( "%I", TQString::number( hour ) );
+ dateTimeString.replace( "%I", TQString::number( hour ) );
if(hour < 10)
{
- dateTimeString.tqreplace( "%i", "0"+TQString::number( hour ) );
+ dateTimeString.replace( "%i", "0"+TQString::number( hour ) );
}
else
{
- dateTimeString.tqreplace( "%i", TQString::number( hour ) );
+ dateTimeString.replace( "%i", TQString::number( hour ) );
}
- dateTimeString.tqreplace( "%p", zone );
+ dateTimeString.replace( "%p", zone );
// minutes
if(time.minute() < 10)
{
- dateTimeString.tqreplace( "%M", "0"+TQString::number( time.minute() ) );
+ dateTimeString.replace( "%M", "0"+TQString::number( time.minute() ) );
}
else
{
- dateTimeString.tqreplace( "%M", TQString::number( time.minute() ) );
+ dateTimeString.replace( "%M", TQString::number( time.minute() ) );
}
// seconds
if(time.second() < 10)
{
- dateTimeString.tqreplace( "%S", "0"+TQString::number( time.second() ) );
+ dateTimeString.replace( "%S", "0"+TQString::number( time.second() ) );
}
else
{
- dateTimeString.tqreplace( "%S", TQString::number( time.second() ) );
+ dateTimeString.replace( "%S", TQString::number( time.second() ) );
}
// timezone
- dateTimeString.tqreplace( "%Z", d->_project->identitySettings().timeZone );
+ dateTimeString.replace( "%Z", d->_project->identitySettings().timeZone );
TQTime t;
const int offset = KRFCDate::localUTCOffset();
const int correction = offset < 0 ? -60 : 60;
t = t.addSecs( offset * correction );
- dateTimeString.tqreplace( "%z", ( offset < 0 ? "-" : "+" ) + t.toString("hhmm") );
+ dateTimeString.replace( "%z", ( offset < 0 ? "-" : "+" ) + t.toString("hhmm") );
break;
}
}
@@ -2179,72 +2179,72 @@ PoInfo Catalog::headerInfo(const CatalogItem headerItem)
// extract information from the header
for(it=header.begin();it!=header.end();++it)
{
- if((*it).tqcontains(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*.+\\s*$")))
+ if((*it).contains(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*.+\\s*$")))
{
- info.project=(*it).tqreplace(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*"),"");
+ info.project=(*it).replace(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*"),"");
if(info.project.right(2)=="\\n")
info.project.remove(info.project.length()-2,2);
info.project=info.project.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*.+\\s*$")))
+ else if((*it).contains(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*.+\\s*$")))
{
- info.creation=(*it).tqreplace(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*"),"");
+ info.creation=(*it).replace(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*"),"");
if(info.creation.right(2)=="\\n")
info.creation.remove(info.creation.length()-2,2);
info.creation=info.creation.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*.+\\s*$")))
+ else if((*it).contains(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*.+\\s*$")))
{
- info.revision=(*it).tqreplace(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*"),"");
+ info.revision=(*it).replace(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*"),"");
if(info.revision.right(2)=="\\n")
info.revision.remove(info.revision.length()-2,2);
info.revision=info.revision.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*Last-Translator\\s*:\\s*.+\\s*$")))
+ else if((*it).contains(TQRegExp("^\\s*Last-Translator\\s*:\\s*.+\\s*$")))
{
- info.lastTranslator=(*it).tqreplace(TQRegExp("^\\s*Last-Translator\\s*:\\s*"),"");
+ info.lastTranslator=(*it).replace(TQRegExp("^\\s*Last-Translator\\s*:\\s*"),"");
if(info.lastTranslator.right(2)=="\\n")
info.lastTranslator.remove(info.lastTranslator.length()-2,2);
info.lastTranslator=info.lastTranslator.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*Language-Team\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*Language-Team\\s*:\\s*.+\\s*")))
{
- info.languageTeam=(*it).tqreplace(TQRegExp("^\\s*Language-Team\\s*:\\s*"),"");
+ info.languageTeam=(*it).replace(TQRegExp("^\\s*Language-Team\\s*:\\s*"),"");
if(info.languageTeam.right(2)=="\\n")
info.languageTeam.remove(info.languageTeam.length()-2,2);
info.languageTeam=info.languageTeam.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*MIME-Version\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*MIME-Version\\s*:\\s*.+\\s*")))
{
- info.mimeVersion=(*it).tqreplace(TQRegExp("^\\s*MIME-Version\\s*:\\s*"),"");
+ info.mimeVersion=(*it).replace(TQRegExp("^\\s*MIME-Version\\s*:\\s*"),"");
if(info.mimeVersion.right(2)=="\\n")
info.mimeVersion.remove(info.mimeVersion.length()-2,2);
info.mimeVersion=info.mimeVersion.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*Content-Type\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*Content-Type\\s*:\\s*.+\\s*")))
{
- info.contentType=(*it).tqreplace(TQRegExp("^\\s*Content-Type\\s*:\\s*"),"");
+ info.contentType=(*it).replace(TQRegExp("^\\s*Content-Type\\s*:\\s*"),"");
if(info.contentType.right(2)=="\\n")
info.contentType.remove(info.contentType.length()-2,2);
info.contentType=info.contentType.simplifyWhiteSpace();
}
- else if((*it).tqcontains(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*.+\\s*")))
{
- info.encoding=(*it).tqreplace(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*"),"");
+ info.encoding=(*it).replace(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*"),"");
if(info.encoding.right(2)=="\\n")
info.encoding.remove(info.encoding.length()-2,2);
@@ -2590,9 +2590,9 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
}
if(findOpts->ignoreAccelMarker
- && targetStr.tqcontains(miscOptions.accelMarker))
+ && targetStr.contains(miscOptions.accelMarker))
{
- accelMarkerPos = targetStr.tqfind(miscOptions.accelMarker);
+ accelMarkerPos = targetStr.find(miscOptions.accelMarker);
targetStr.remove(accelMarkerPos,1);
if(docPos.offset > (uint)accelMarkerPos)
@@ -2605,7 +2605,7 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
if(findOpts->wholeWords) {
TQString pre=targetStr.mid(pos-1,1);
TQString post=targetStr.mid(pos+len,1);
- if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
success=true;
docPos.offset=pos;
}
@@ -2617,13 +2617,13 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
}
}
else {
- if( (pos=targetStr.tqfind(searchStr,docPos.offset,findOpts->caseSensitive)) >= 0 ) {
+ if( (pos=targetStr.find(searchStr,docPos.offset,findOpts->caseSensitive)) >= 0 ) {
len=searchStr.length();
if(findOpts->wholeWords) {
TQString pre=targetStr.mid(pos-1,1);
TQString post=targetStr.mid(pos+len,1);
- if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
success=true;
docPos.offset=pos;
}
@@ -2839,9 +2839,9 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
}
if(findOpts->ignoreAccelMarker
- && targetStr.tqcontains(miscOptions.accelMarker))
+ && targetStr.contains(miscOptions.accelMarker))
{
- accelMarkerPos = targetStr.tqfind(miscOptions.accelMarker);
+ accelMarkerPos = targetStr.find(miscOptions.accelMarker);
targetStr.remove(accelMarkerPos,1);
if(docPos.offset > (uint)accelMarkerPos)
@@ -2854,7 +2854,7 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
else if( findOpts->isRegExp ) {
/*
don't work!?
- if((pos=targetStr.tqfindRev(regexp,docPos.offset)) >= 0 ) {
+ if((pos=targetStr.findRev(regexp,docPos.offset)) >= 0 ) {
regexp.match(targetStr,pos,&len); // to get the length of the string
*/
bool found=false;
@@ -2871,7 +2871,7 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
if(findOpts->wholeWords) {
TQString pre=targetStr.mid(pos-1,1);
TQString post=targetStr.mid(pos+len,1);
- if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
success=true;
docPos.offset=pos;
}
@@ -2882,13 +2882,13 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
}
}
}
- else if( (pos=targetStr.tqfindRev(searchStr,docPos.offset-1,findOpts->caseSensitive)) >= 0
+ else if( (pos=targetStr.findRev(searchStr,docPos.offset-1,findOpts->caseSensitive)) >= 0
&& (uint)pos < docPos.offset) {
len=searchStr.length();
if(findOpts->wholeWords) {
TQString pre=targetStr.mid(pos-1,1);
TQString post=targetStr.mid(pos+len,1);
- if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
success=true;
docPos.offset=pos;
}
@@ -3071,8 +3071,8 @@ Catalog::DiffResult Catalog::diff(uint entry, TQString *result)
// then look if the same msgid is contained in the diff file
// FIXME: should care about plural forms in msgid
TQString id = msgid(entry).first();
- id.tqreplace( "\n","");
- if(d->msgidDiffList.tqcontains(id))
+ id.replace( "\n","");
+ if(d->msgidDiffList.contains(id))
{
// FIXME:: should care about plural forms in msgid
*result = msgid(entry).first();
@@ -3091,8 +3091,8 @@ Catalog::DiffResult Catalog::diff(uint entry, TQString *result)
// then look if there are entries with the same translation
kdWarning() << "Diff feature (2) does not work with plural forms" << endl;
TQString str = msgstr(entry).first();
- str.tqreplace("\n","");
- if(d->msgstr2MsgidDiffList.tqcontains(str))
+ str.replace("\n","");
+ if(d->msgstr2MsgidDiffList.contains(str))
{
TQStringList list = d->msgstr2MsgidDiffList[str];
@@ -3193,7 +3193,7 @@ Catalog::DiffResult Catalog::diff(uint entry, TQString *result)
TQString r = wordDiff(idForDiff,id);
//esp for plural forms
- *result = r.tqreplace("\\n<KBABELADD>" + TQString(TQChar(0x00B6)) + "</KBABELADD>", "\\n\n");
+ *result = r.replace("\\n<KBABELADD>" + TQString(TQChar(0x00B6)) + "</KBABELADD>", "\\n\n");
s = new TQString(*result);
if( !d->diffCache.insert(entry,s) )
@@ -3236,14 +3236,14 @@ void Catalog::setDiffList( const TQValueList<DiffEntry>& list)
}
TQString id = (*it).msgid;
- id.tqreplace("\n","");
+ id.replace("\n","");
TQString str = (*it).msgstr;
- str.tqreplace("\n","");
+ str.replace("\n","");
d->msgidDiffList.append(id);
if(!str.isEmpty())
{
- if(d->msgstr2MsgidDiffList.tqcontains(str))
+ if(d->msgstr2MsgidDiffList.contains(str))
{
TQStringList sl = d->msgstr2MsgidDiffList[str];
sl.append(id);
@@ -3506,4 +3506,4 @@ void Catalog::wordCount (uint &total, uint &fuzzy, uint &untranslated) const
#include "catalog.moc"
-// kate: space-indent on; indent-width 4; tqreplace-tabs on;
+// kate: space-indent on; indent-width 4; replace-tabs on;