summaryrefslogtreecommitdiffstats
path: root/kbabel/datatools
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/datatools
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/datatools')
-rw-r--r--kbabel/datatools/accelerators/main.cc12
-rw-r--r--kbabel/datatools/arguments/main.cc26
-rw-r--r--kbabel/datatools/context/main.cc4
-rw-r--r--kbabel/datatools/equations/main.cc8
-rw-r--r--kbabel/datatools/length/main.cc6
-rw-r--r--kbabel/datatools/not-translated/main.cc4
-rw-r--r--kbabel/datatools/pluralforms/main.cc4
-rw-r--r--kbabel/datatools/punctuation/main.cc6
-rw-r--r--kbabel/datatools/whitespace/main.cc10
-rw-r--r--kbabel/datatools/xml/main.cc20
10 files changed, 50 insertions, 50 deletions
diff --git a/kbabel/datatools/accelerators/main.cc b/kbabel/datatools/accelerators/main.cc
index b082c635..3b13b2bf 100644
--- a/kbabel/datatools/accelerators/main.cc
+++ b/kbabel/datatools/accelerators/main.cc
@@ -97,8 +97,8 @@ bool AcceleratorTool::run( const TQString& command, void* data, const TQString&
{
// FIXME: this should care about plural forms in msgid
TQString lineid=item->msgid().first();
- lineid.tqreplace( _context, "");
- lineid.tqreplace(TQRegExp("\\n"),"");
+ lineid.replace( _context, "");
+ lineid.replace(TQRegExp("\\n"),"");
lineid.simplifyWhiteSpace();
TQString regStr(_marker);
regStr+="[^\\s]";
@@ -110,12 +110,12 @@ bool AcceleratorTool::run( const TQString& command, void* data, const TQString&
TQString linestr=(*form);
linestr.simplifyWhiteSpace();
- int n = lineid.tqcontains(reg);
+ int n = lineid.contains(reg);
if( _marker == '&' )
- n = n - lineid.tqcontains(TQRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))"));
- int m = linestr.tqcontains(reg);
+ n = n - lineid.contains(TQRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))"));
+ int m = linestr.contains(reg);
if( _marker == '&' )
- m = m - linestr.tqcontains(TQRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))"));
+ m = m - linestr.contains(TQRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))"));
hasError = hasError || ( n<=1 && m != n);
}
}
diff --git a/kbabel/datatools/arguments/main.cc b/kbabel/datatools/arguments/main.cc
index 4b533061..43ae38b4 100644
--- a/kbabel/datatools/arguments/main.cc
+++ b/kbabel/datatools/arguments/main.cc
@@ -110,46 +110,46 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat
if( line.startsWith("_n:" ))
{
// truncate text after first \n to get args only once
- line = line.mid(0,line.tqfind("\\n"));
+ line = line.mid(0,line.find("\\n"));
}
}
- line.tqreplace(_context, "");
- line.tqreplace(TQRegExp("\\n"),"");
+ line.replace(_context, "");
+ line.replace(TQRegExp("\\n"),"");
line.simplifyWhiteSpace();
// flag, for GNU only we can allow reordering
bool non_gnu = (item->pluralForm() == KDESpecific);
- int index=line.tqfind(TQRegExp("%."));
+ int index=line.find(TQRegExp("%."));
while(index>=0)
{
- int endIndex=line.tqfind(TQRegExp("[^\\d]"),index+1);
+ int endIndex=line.find(TQRegExp("[^\\d]"),index+1);
if(endIndex<0)
{
endIndex=line.length();
}
- else if( formatChars.tqcontains(line[endIndex]) )
+ else if( formatChars.contains(line[endIndex]) )
{
endIndex++;
}
if(endIndex - index > 1 ) {
TQString arg = line.mid(index,endIndex-index);
- if( arg.tqcontains( TQRegExp("\\d") ) ) {
+ if( arg.contains( TQRegExp("\\d") ) ) {
non_gnu = true;
}
argList.append(arg);
}
- index=line.tqfind(TQRegExp("%."),endIndex);
+ index=line.find(TQRegExp("%."),endIndex);
}
if( item->pluralForm()==KDESpecific)
{
// FIXME: this is KDE specific
- if( _checkPlurals && line.startsWith("_n:" ) && !argList.tqcontains("%n") )
+ if( _checkPlurals && line.startsWith("_n:" ) && !argList.contains("%n") )
{
argList.append("%n");
}
@@ -180,7 +180,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat
line=(*i);
- line.tqreplace(TQRegExp("\\n"),"");
+ line.replace(TQRegExp("\\n"),"");
TQRegExp argdesc(
"%((["+formatChars+"])"
@@ -196,7 +196,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat
if( index == -1 ) break;
// do not add a redundant argument, if it is non GNU
- if( !non_gnu || !foundArgs.tqcontains( argdesc.cap(0) ) )
+ if( !non_gnu || !foundArgs.contains( argdesc.cap(0) ) )
foundArgs.append( argdesc.cap( 0 ) );
} while( true );
@@ -205,7 +205,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat
if( non_gnu ) {
for ( TQStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it ) {
- if( argList.tqfind( *it ) == argList.end() ) {
+ if( argList.find( *it ) == argList.end() ) {
hasError = true;
break;
} else {
@@ -227,7 +227,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat
*oit = TQString();
} else {
// try to strip replacement
- int index = (*it).tqfind( '$' );
+ int index = (*it).find( '$' );
if( index == -1 ) {
// there is no replacement, this is wrong
hasError = true;
diff --git a/kbabel/datatools/context/main.cc b/kbabel/datatools/context/main.cc
index ed89f125..5a17e8c3 100644
--- a/kbabel/datatools/context/main.cc
+++ b/kbabel/datatools/context/main.cc
@@ -92,8 +92,8 @@ bool ContextTool::run( const TQString& command, void* data, const TQString& data
bool hasError = false;
- if(!item->isUntranslated() && item->msgid().first().tqcontains(_context)
- && item->msgstr().first().tqcontains(_context) )
+ if(!item->isUntranslated() && item->msgid().first().contains(_context)
+ && item->msgstr().first().contains(_context) )
{
hasError = true;
}
diff --git a/kbabel/datatools/equations/main.cc b/kbabel/datatools/equations/main.cc
index 96cb3057..cb1e1f7b 100644
--- a/kbabel/datatools/equations/main.cc
+++ b/kbabel/datatools/equations/main.cc
@@ -86,12 +86,12 @@ bool EquationsTool::run( const TQString& command, void* data, const TQString& da
bool hasError = false;
- if(!item->isUntranslated() && !item->msgid().first().tqcontains('\n')
- && item->msgid().first().tqcontains(_equation))
+ if(!item->isUntranslated() && !item->msgid().first().contains('\n')
+ && item->msgid().first().contains(_equation))
{
- int index = item->msgid().first().tqfind('=');
+ int index = item->msgid().first().find('=');
TQString left = item->msgid().first().left(index);
- index = item->msgstr().first().tqfind('=');
+ index = item->msgstr().first().find('=');
if(left != item->msgstr().first().left(index))
hasError = true;
}
diff --git a/kbabel/datatools/length/main.cc b/kbabel/datatools/length/main.cc
index 2851429e..706cf10c 100644
--- a/kbabel/datatools/length/main.cc
+++ b/kbabel/datatools/length/main.cc
@@ -104,7 +104,7 @@ bool LengthTool::run( const TQString& command, void* data, const TQString& datat
if( item->pluralForm() == KDESpecific ) {
str = TQStringList::split( "\\n", item->msgstr().first(), true );
id = TQStringList::split( "\\n",
- item->msgid().first().tqreplace( TQRegExp(_plurals), ""), true );
+ item->msgid().first().replace( TQRegExp(_plurals), ""), true );
} else {
str = item->msgstr();
id = item->msgid();
@@ -113,12 +113,12 @@ bool LengthTool::run( const TQString& command, void* data, const TQString& datat
//Check for translations that are too short or too long
//This may not be totally correct but we check both
//the singular and plural forms against each translated plural.
- //FIXME: tqreplace 10% check with configurable setting or a statistical
+ //FIXME: replace 10% check with configurable setting or a statistical
//based expected length relationship
int idlen, strlen;
for( TQStringList::Iterator i = id.begin() ; i != id.end() ; i++ ) {
TQString iditem = (*i);
- idlen = iditem.tqreplace( TQRegExp(_context),"").length();
+ idlen = iditem.replace( TQRegExp(_context),"").length();
for( TQStringList::Iterator j = str.begin() ; j != str.end() ; j++ ) {
TQString stritem = (*j);
strlen = stritem.length();
diff --git a/kbabel/datatools/not-translated/main.cc b/kbabel/datatools/not-translated/main.cc
index 3082c552..9159c011 100644
--- a/kbabel/datatools/not-translated/main.cc
+++ b/kbabel/datatools/not-translated/main.cc
@@ -101,13 +101,13 @@ bool NotTranslatedTool::run( const TQString& command, void* data, const TQString
if( item->pluralForm() == KDESpecific ) {
str = TQStringList::split( "\\n", item->msgstr().first(), true );
id = TQStringList::split( "\\n",
- item->msgid().first().tqreplace( TQRegExp(_plurals), ""), true );
+ item->msgid().first().replace( TQRegExp(_plurals), ""), true );
} else {
str = item->msgstr();
id = item->msgid();
}
for( TQStringList::Iterator i = id.begin() ; i != id.end() ; i++ ) {
- TQString id_str = (*i).tqreplace( TQRegExp(_context), "");
+ TQString id_str = (*i).replace( TQRegExp(_context), "");
for( TQStringList::Iterator j = str.begin() ; j != str.end() ; j++ ) {
TQString str_str = (*j);
hasError = hasError || ( id_str == str_str );
diff --git a/kbabel/datatools/pluralforms/main.cc b/kbabel/datatools/pluralforms/main.cc
index 9005b4ce..5bc9e904 100644
--- a/kbabel/datatools/pluralforms/main.cc
+++ b/kbabel/datatools/pluralforms/main.cc
@@ -102,11 +102,11 @@ bool PluralsTool::run( const TQString& command, void* data, const TQString& data
if(!item->isUntranslated() && item->pluralForm() == KDESpecific )
{
- if(_neededForms <= 0 || item->msgstr().first().tqcontains(_plurals))
+ if(_neededForms <= 0 || item->msgstr().first().contains(_plurals))
{
hasError = true;
}
- else if( item->msgstr().first().tqcontains(TQString("\\n"))+1 != _neededForms )
+ else if( item->msgstr().first().contains(TQString("\\n"))+1 != _neededForms )
{
hasError = true;
}
diff --git a/kbabel/datatools/punctuation/main.cc b/kbabel/datatools/punctuation/main.cc
index 42b2f2eb..3b2bc35e 100644
--- a/kbabel/datatools/punctuation/main.cc
+++ b/kbabel/datatools/punctuation/main.cc
@@ -92,7 +92,7 @@ bool PunctuationTool::run( const TQString& command, void* data, const TQString&
// lookup punctuation in original text
TQRegExp punc("[\\.!\\?:]+$");
- int i = lineid.tqfind(punc);
+ int i = lineid.find(punc);
TQString t("");
@@ -102,7 +102,7 @@ bool PunctuationTool::run( const TQString& command, void* data, const TQString&
{
// check, that both plural forms contain the same punctuation
TQString pl = *(item->msgid().at(1));
- int j = pl.tqfind(punc);
+ int j = pl.find(punc);
TQString tp("");
if( j != -1 ) tp = pl.right(pl.length()-j);
@@ -122,7 +122,7 @@ bool PunctuationTool::run( const TQString& command, void* data, const TQString&
{
TQString linestr=(*form);
- int j = linestr.tqfind(punc);
+ int j = linestr.find(punc);
// there is no punctuation in original, but one in the translation
if( i == -1 && j != i )
diff --git a/kbabel/datatools/whitespace/main.cc b/kbabel/datatools/whitespace/main.cc
index 3fdd0f47..68548501 100644
--- a/kbabel/datatools/whitespace/main.cc
+++ b/kbabel/datatools/whitespace/main.cc
@@ -104,27 +104,27 @@ bool WhitespaceTool::run( const TQString& command, void* data, const TQString& d
if( item->pluralForm() == KDESpecific ) {
str = TQStringList::split( "\\n", item->msgstr().first(), true );
id = TQStringList::split( "\\n",
- item->msgid().first().tqreplace( TQRegExp(_plurals), ""), true );
+ item->msgid().first().replace( TQRegExp(_plurals), ""), true );
} else {
str = item->msgstr();
id = item->msgid();
}
//Strip equations
- id.first().tqreplace( TQRegExp(_equation), "");
- str.first().tqreplace( TQRegExp(_equation), "");
+ id.first().replace( TQRegExp(_equation), "");
+ str.first().replace( TQRegExp(_equation), "");
//Ignore Messages with blank msgid components
for( TQStringList::Iterator it = id.begin() ; it != id.end() ; it++ ) {
TQString resultstring = (*it);
- hasIdError = hasIdError || resultstring.tqcontains(_whitespace);
+ hasIdError = hasIdError || resultstring.contains(_whitespace);
}
if( hasIdError ) return true;
//Check each TQString in the List is not whitespace
for( TQStringList::Iterator it = str.begin() ; it != str.end() ; it++ ) {
TQString resultstring = (*it);
- hasStrError = hasStrError || resultstring.tqcontains(_whitespace);
+ hasStrError = hasStrError || resultstring.contains(_whitespace);
}
}
diff --git a/kbabel/datatools/xml/main.cc b/kbabel/datatools/xml/main.cc
index 57a6f785..229ce734 100644
--- a/kbabel/datatools/xml/main.cc
+++ b/kbabel/datatools/xml/main.cc
@@ -94,12 +94,12 @@ bool XMLTool::run( const TQString& command, void* data, const TQString& datatype
uint correctnessLevel = 0;
TQString msgid = item->msgid().first();
- msgid.tqreplace( "\\\"", "\"" ); // Change '\"' to '"'
- msgid.tqreplace( TQRegExp( "&(?![a-zA-Z0-9]+;)" ), "&amp;" );
- msgid.tqreplace( _context, "" );
- msgid.tqreplace("\n",""); // delete newlines
+ msgid.replace( "\\\"", "\"" ); // Change '\"' to '"'
+ msgid.replace( TQRegExp( "&(?![a-zA-Z0-9]+;)" ), "&amp;" );
+ msgid.replace( _context, "" );
+ msgid.replace("\n",""); // delete newlines
- if( _levelCache.tqcontains(msgid) )
+ if( _levelCache.contains(msgid) )
{
correctnessLevel = _levelCache[msgid];
}
@@ -134,8 +134,8 @@ bool XMLTool::run( const TQString& command, void* data, const TQString& datatype
for( TQStringList::Iterator form = str.begin() ; form != str.end() ; form++ )
{
TQString text=(*form);
- text.tqreplace( "\\\"", "\"" ); // Change '\"' to '"'
- text.tqreplace( TQRegExp( "&(?![a-zA-Z0-9]+;)" ), "&amp;" );
+ text.replace( "\\\"", "\"" ); // Change '\"' to '"'
+ text.replace( TQRegExp( "&(?![a-zA-Z0-9]+;)" ), "&amp;" );
// isNonCaseWithoutCommonCompliant can fail
// even though higher level checks works
@@ -189,16 +189,16 @@ bool XMLTool::isNonCaseWithoutCommonCompliant( const TQString& text)
TQDomDocument doc;
TQString test = text.lower();
TQRegExp rx( "(<br>)|(<hr>)|(<p>)||(<\\w+@(\\w+.)*\\w+>)" );
- test.tqreplace( rx, "" );
+ test.replace( rx, "" );
TQString a;
do
{
a = test;
- test.tqreplace( TQRegExp("<[^_:A-Za-z/]"), "" );
+ test.replace( TQRegExp("<[^_:A-Za-z/]"), "" );
} while( a!=test);
- test.tqreplace( TQRegExp("<$"), "" );
+ test.replace( TQRegExp("<$"), "" );
return doc.setContent("<para>" + test + "</para>" );
}