summaryrefslogtreecommitdiffstats
path: root/kbabel/common/catalog.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/common/catalog.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/common/catalog.cpp')
-rw-r--r--kbabel/common/catalog.cpp280
1 files changed, 140 insertions, 140 deletions
diff --git a/kbabel/common/catalog.cpp b/kbabel/common/catalog.cpp
index d6501c3e..3639748c 100644
--- a/kbabel/common/catalog.cpp
+++ b/kbabel/common/catalog.cpp
@@ -21,11 +21,11 @@
In addition, as a special exception, the copyright holders give
permission to link the code of this program with any edition of
- the Qt library by Trolltech AS, Norway (or with modified versions
- of Qt that use the same license as Qt), and distribute linked
+ the TQt library by Trolltech AS, Norway (or with modified versions
+ of TQt that use the same license as TQt), and distribute linked
combinations including the two. You must obey the GNU General
Public License in all respects for all of the code used other than
- Qt. If you modify this file, you may extend this exception to
+ TQt. If you modify this file, you may extend this exception to
your version of the file, but you are not obligated to do so. If
you do not wish to do so, delete this exception statement from
your version.
@@ -70,8 +70,8 @@
#include <kmessagebox.h>
using namespace KBabel;
-Catalog::Catalog(TQObject* parent, const char* name, TQString projectFile)
- : TQObject(parent,name)
+Catalog::Catalog(TQObject* tqparent, const char* name, TQString projectFile)
+ : TQObject(tqparent,name)
{
if ( projectFile.isEmpty() )
projectFile = KBabel::ProjectManager::defaultProjectName();
@@ -79,7 +79,7 @@ Catalog::Catalog(TQObject* parent, const char* name, TQString projectFile)
readPreferences();
}
-Catalog::Catalog(const Catalog& c): TQObject(c.parent(),c.name()
+Catalog::Catalog(const Catalog& c): TQObject(c.tqparent(),c.name()
)
{
kdFatal() << "Copy constructor of Catalog, please report how to reproduce to the authors" << endl;
@@ -93,7 +93,7 @@ Catalog::~Catalog()
TQString Catalog::msgctxt(uint index) const
{
if ( d->_entries.isEmpty() )
- return TQString::null;
+ return TQString();
uint max=d->_entries.count()-1;
if(index > max)
index=max;
@@ -103,7 +103,7 @@ TQString Catalog::msgctxt(uint index) const
TQStringList Catalog::msgid(uint index, const bool noNewlines) const
{
if ( d->_entries.isEmpty() )
- return TQString::null;
+ return TQString();
uint max=d->_entries.count()-1;
if(index > max)
index=max;
@@ -114,7 +114,7 @@ TQStringList Catalog::msgid(uint index, const bool noNewlines) const
TQStringList Catalog::msgstr(uint index, const bool noNewlines) const
{
if ( d->_entries.isEmpty() )
- return TQString::null;
+ return TQString();
uint max=d->_entries.count()-1;
if(index > max)
@@ -126,7 +126,7 @@ TQStringList Catalog::msgstr(uint index, const bool noNewlines) const
TQString Catalog::comment(uint index) const
{
if ( d->_entries.isEmpty() )
- return TQString::null;
+ return TQString();
uint max=d->_entries.count()-1;
if(index > max)
index=max;
@@ -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).contains(id)))
+ while(it != d->_entries.end() && !((*it).msgid(true).tqcontains(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.replace ("\n", "");
- values.replace ("\\n", "\\n\n");
+ values.tqreplace ("\n", "");
+ values.tqreplace ("\\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).contains(TQRegExp("^ *Last-Translator:.*")))
+ if((*it).tqcontains(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).contains(TQRegExp("^ *PO-Revision-Date:.*")))
+ if((*it).tqcontains(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.replace( "@PACKAGE@", packageName());
+ temp.tqreplace( "@PACKAGE@", packageName());
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).contains(TQRegExp("^ *Project-Id-Version:.*")))
+ if((*it).tqcontains(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).contains(TQRegExp("^ *Language-Team:.*")))
+ if((*it).tqcontains(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).find( TQRegExp( "^ *Content-Type:.*" ) ) != -1 )
+ if( (*it).tqfind( 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).contains(TQRegExp("^ *Content-Transfer-Encoding:.*")))
+ if((*it).tqcontains(TQRegExp("^ *Content-Transfer-Encoding:.*")))
{
(*it) = temp;
found=true;
@@ -497,12 +497,12 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
}
temp="X-Generator: KBabel %1\\n";
- temp=temp.arg(VERSION);
+ temp=temp.tqarg(VERSION);
found=false;
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).contains(TQRegExp("^ *X-Generator:.*")))
+ if((*it).tqcontains(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).contains(TQRegExp("^ *MIME-Version:")))
+ if((*it).tqcontains(TQRegExp("^ *MIME-Version:")))
{
(*it) = temp;
found=true;
@@ -533,7 +533,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
temp="Plural-Forms: %1\\n";
- temp=temp.arg(identityOptions.gnuPluralFormHeader);
+ temp=temp.tqarg(identityOptions.gnuPluralFormHeader);
found=false;
// update plural form header
@@ -541,7 +541,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
{
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).contains(TQRegExp("^ *Plural-Forms:")))
+ if((*it).tqcontains(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).find( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9).*Free Software Foundation, Inc") ) != -1 )
+ if ( (*it).tqfind( 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).find( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9) YEAR Free Software Foundation, Inc\\.") ) != -1 )
+ if ( (*it).tqfind( 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).replace("YEAR", TQDate::currentDate().toString("yyyy"));
+ (*it).tqreplace("YEAR", TQDate::tqcurrentDate().toString("yyyy"));
} else
if( saveOptions.FSFCopyright == ProjectSettingsBase::Update )
{
//update years
- TQString cy = TQDate::currentDate().toString("yyyy");
- if( !(*it).contains( TQRegExp(cy)) ) // is the year already included?
+ TQString cy = TQDate::tqcurrentDate().toString("yyyy");
+ if( !(*it).tqcontains( TQRegExp(cy)) ) // is the year already included?
{
- int index = (*it).findRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
+ int index = (*it).tqfindRev( 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.replace( "@PACKAGE@", packageName());
- temp.replace( "@LANGUAGE@", identityOptions.languageName);
+ temp.tqreplace( "@PACKAGE@", packageName());
+ temp.tqreplace( "@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.replace( "@PACKAGE@", ".*" );
- regexpstr.replace( "@LANGUAGE@", ".*" );
+ regexpstr.tqreplace( "@PACKAGE@", ".*" );
+ regexpstr.tqreplace( "@LANGUAGE@", ".*" );
//kdDebug() << "REGEXPSTR: " << regexpstr << endl;
TQRegExp regexp ( regexpstr );
@@ -674,7 +674,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
{
temp+=(" <"+identityOptions.authorEmail+">");
}
- temp+=", "+TQDate::currentDate().toString("yyyy")+".";
+ temp+=", "+TQDate::tqcurrentDate().toString("yyyy")+".";
// ### TODO: it would be nice if the entry could start with "COPYRIGHT" and have the "(C)" symbol (both not mandatory)
TQRegExp regexpAuthorYear( "^#.*(<.+@.+>)?,\\s*([\\d]+[\\d\\-, ]*|YEAR)" );
@@ -683,11 +683,11 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
while ( it != commentList.end() )
{
bool deleteItem = false;
- if ( (*it).find ( "copyright", 0, false ) != -1 )
+ if ( (*it).tqfind ( "copyright", 0, false ) != -1 )
{
// We have a line with a copyright. It should not be moved.
}
- else if ( (*it).find ( regexpYearAlone ) != -1 )
+ else if ( (*it).tqfind ( 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).find ( regexpAuthorYear ) != -1 ) // email address followed by year
+ else if ( (*it).tqfind ( regexpAuthorYear ) != -1 ) // email address followed by year
{
- if ( foundAuthors.find( (*it) ) == foundAuthors.end() )
+ if ( foundAuthors.tqfind( (*it) ) == foundAuthors.end() )
{
// The author line is new (and not a duplicate), so add it to the author line list
foundAuthors.append( (*it) );
@@ -721,17 +721,17 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
found = false;
bool foundAuthor = false;
- const TQString cy = TQDate::currentDate().toString("yyyy");
+ const TQString cy = TQDate::tqcurrentDate().toString("yyyy");
ait = foundAuthors.end();
for( it = foundAuthors.begin() ; it!=foundAuthors.end(); ++it )
{
- if ( (*it).find( TQRegExp(
+ if ( (*it).tqfind( TQRegExp(
TQRegExp::escape( identityOptions.authorName )+".*"
+ TQRegExp::escape( identityOptions.authorEmail ) ) ) != -1 )
{
foundAuthor = true;
- if( (*it).find( cy ) != -1 )
+ if( (*it).tqfind( 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).findRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
+ const int index = (*ait).tqfindRev( 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).find( TQRegExp( "^#(\\s*$|[:,\\.])" ) ) == -1 ) );
+ while( ( it != commentList.begin() ) && ( (*it).tqfind( TQRegExp( "^#(\\s*$|[:,\\.])" ) ) == -1 ) );
++it;
for( ait = foundAuthors.begin() ; ait != foundAuthors.end() ; ++ait )
{
@@ -816,7 +816,7 @@ void Catalog::setFuzzy(uint index, bool on)
}
-void Catalog::removeFuzzyStatus(uint index)
+void Catalog::removeFuzzytqStatus(uint index)
{
setFuzzy(index,false);
}
@@ -838,7 +838,7 @@ TQString Catalog::packageName() const
TQString package=d->_url.fileName();
- int index=package.find(TQRegExp("(\\."+identitySettings().languageCode+")?\\.pot?$"));
+ int index=package.tqfind(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.findRev( '/' );
+ const int pos = package.tqfindRev( '/' );
if( pos < 0 )
{
d->_packageDir = TQString();
@@ -888,10 +888,10 @@ TQString Catalog::encoding() const
return encodingStr;
}
-ConversionStatus Catalog::openURL(const KURL& url, const TQString& package)
+ConversiontqStatus Catalog::openURL(const KURL& url, const TQString& package)
{
TQString target;
- ConversionStatus error = OK;
+ ConversiontqStatus error = OK;
if(KIO::NetAccess::download(url, target, NULL))
{
@@ -971,8 +971,8 @@ ConversionStatus Catalog::openURL(const KURL& url, const TQString& package)
if( package.isEmpty() )
{
- d->_packageName=TQString::null;
- d->_packageDir=TQString::null;
+ d->_packageName=TQString();
+ d->_packageDir=TQString();
}
else setPackage(package);
@@ -992,10 +992,10 @@ ConversionStatus Catalog::openURL(const KURL& url, const TQString& package)
}
}
-ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, const TQString& package)
+ConversiontqStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, const TQString& package)
{
TQString target;
- ConversionStatus error = OK;
+ ConversiontqStatus error = OK;
if(KIO::NetAccess::download(openUrl, target, NULL))
{
@@ -1069,8 +1069,8 @@ ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, cons
d->_url = saveURL;
if( package.isEmpty() )
{
- d->_packageName=TQString::null;
- d->_packageDir=TQString::null;
+ d->_packageName=TQString();
+ d->_packageDir=TQString();
}
else setPackage(package);
@@ -1093,9 +1093,9 @@ ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, cons
}
}
-Msgfmt::Status Catalog::checkSyntax(TQString& output, bool clearErrors)
+Msgfmt::tqStatus Catalog::checkSyntax(TQString& output, bool clearErrors)
{
- if( !d->_mimeTypes.contains( "application/x-gettext" ) )
+ if( !d->_mimeTypes.tqcontains( "application/x-gettext" ) )
return Msgfmt::Unsupported;
TQString filename;
@@ -1112,7 +1112,7 @@ Msgfmt::Status Catalog::checkSyntax(TQString& output, bool clearErrors)
}
Msgfmt msgfmt;
- Msgfmt::Status result = msgfmt.checkSyntax( filename , output, pluralFormType() != KDESpecific );
+ Msgfmt::tqStatus result = msgfmt.checkSyntax( filename , output, pluralFormType() != KDESpecific );
if( clearErrors) clearErrorList();
@@ -1128,10 +1128,10 @@ Msgfmt::Status 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).find(TQRegExp("^.+:\\d+:")) >= 0 )
+ if( (*it).tqfind(TQRegExp("^.+:\\d+:")) >= 0 )
{
- const int begin=(*it).find(":",0)+1;
- const int end=(*it).find(":",begin);
+ const int begin=(*it).tqfind(":",0)+1;
+ const int end=(*it).tqfind(":",begin);
const TQString line=(*it).mid(begin,end-begin);
@@ -1148,7 +1148,7 @@ Msgfmt::Status Catalog::checkSyntax(TQString& output, bool clearErrors)
continue;
}
- if( !d->_errorIndex.contains(currentIndex) )
+ if( !d->_errorIndex.tqcontains(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.contains(index))
+ if(d->_errorIndex.tqcontains(index))
{
d->_errorIndex.remove(index);
d->_entries[index].setSyntaxError(false);
@@ -1185,7 +1185,7 @@ void Catalog::removeFromErrorList(uint index)
}
}
-TQStringList Catalog::itemStatus(uint index, bool recheck, TQPtrList<KDataTool> whatToCheck)
+TQStringList Catalog::itemtqStatus(uint index, bool recheck, TQPtrList<KDataTool> whatToCheck)
{
if ( d->_entries.isEmpty() )
return TQStringList();
@@ -1207,7 +1207,7 @@ TQStringList Catalog::itemStatus(uint index, bool recheck, TQPtrList<KDataTool>
return item.errors();
}
-TQStringList Catalog::itemStatus(uint index)
+TQStringList Catalog::itemtqStatus(uint index)
{
if ( d->_entries.isEmpty() )
return TQStringList();
@@ -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.contains(index) )
+ if( !d->_errorIndex.tqcontains(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.contains(index) )
+ if( d->_errorIndex.tqcontains(index) )
{
pos.item=index;
pos.form=0;
@@ -1734,7 +1734,7 @@ int Catalog::findNextInList(const TQValueList<uint>& list,uint index) const
int nextIndex=-1;
// find index in List
- it=list.find(index);
+ it=list.tqfind(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.find(index);
+ it=list.tqfind(index);
// if the given index is found in the list and not the last entry
// in the list, return the next listentry
@@ -1800,7 +1800,7 @@ int Catalog::findPrevInList(const TQValueList<uint>& list,uint index) const
TQString Catalog::dateTime() const
{
- const TQDateTime dt = TQDateTime::currentDateTime();
+ const TQDateTime dt = TQDateTime::tqcurrentDateTime();
TQString dateTimeString;
const SaveSettings options = d->_project->saveSettings();
@@ -1831,49 +1831,49 @@ TQString Catalog::dateTime() const
const TQTime time = dt.time();
// the year
- dateTimeString.replace( "%Y", TQString::number( date.year() ) );
- dateTimeString.replace( "%y", TQString::number( date.year() ).right(2) );
+ dateTimeString.tqreplace( "%Y", TQString::number( date.year() ) );
+ dateTimeString.tqreplace( "%y", TQString::number( date.year() ).right(2) );
// the month
if(date.month()<10)
{
- dateTimeString.replace( "%m", "0"+TQString::number( date.month() ) );
+ dateTimeString.tqreplace( "%m", "0"+TQString::number( date.month() ) );
}
else
{
- dateTimeString.replace( "%m", TQString::number( date.month() ) );
+ dateTimeString.tqreplace( "%m", TQString::number( date.month() ) );
}
- dateTimeString.replace( "%f", TQString::number( date.month() ) );
+ dateTimeString.tqreplace( "%f", TQString::number( date.month() ) );
- dateTimeString.replace( "%b", date.longMonthName(date.month()) );
- dateTimeString.replace( "%h", date.longMonthName(date.month()) );
+ dateTimeString.tqreplace( "%b", date.longMonthName(date.month()) );
+ dateTimeString.tqreplace( "%h", date.longMonthName(date.month()) );
// the day
- dateTimeString.replace( "%j", TQString::number( date.dayOfYear() ) );
- dateTimeString.replace( "%e", TQString::number( date.day() ) );
+ dateTimeString.tqreplace( "%j", TQString::number( date.dayOfYear() ) );
+ dateTimeString.tqreplace( "%e", TQString::number( date.day() ) );
if(date.day() < 10)
{
- dateTimeString.replace( "%d", "0"+TQString::number( date.day() ) );
+ dateTimeString.tqreplace( "%d", "0"+TQString::number( date.day() ) );
}
else
{
- dateTimeString.replace( "%d", TQString::number( date.day() ) );
+ dateTimeString.tqreplace( "%d", TQString::number( date.day() ) );
}
- dateTimeString.replace( "%a", date.longDayName( date.dayOfWeek() ) );
+ dateTimeString.tqreplace( "%a", date.longDayName( date.dayOfWeek() ) );
// hour
- dateTimeString.replace( "%k", TQString::number( time.hour() ) );
+ dateTimeString.tqreplace( "%k", TQString::number( time.hour() ) );
if(time.hour() < 10)
{
- dateTimeString.replace( "%H", "0"+TQString::number( time.hour() ) );
+ dateTimeString.tqreplace( "%H", "0"+TQString::number( time.hour() ) );
}
else
{
- dateTimeString.replace( "%H", TQString::number( time.hour() ) );
+ dateTimeString.tqreplace( "%H", TQString::number( time.hour() ) );
}
TQString zone; // AM or PM
@@ -1888,46 +1888,46 @@ TQString Catalog::dateTime() const
zone="AM";
}
- dateTimeString.replace( "%I", TQString::number( hour ) );
+ dateTimeString.tqreplace( "%I", TQString::number( hour ) );
if(hour < 10)
{
- dateTimeString.replace( "%i", "0"+TQString::number( hour ) );
+ dateTimeString.tqreplace( "%i", "0"+TQString::number( hour ) );
}
else
{
- dateTimeString.replace( "%i", TQString::number( hour ) );
+ dateTimeString.tqreplace( "%i", TQString::number( hour ) );
}
- dateTimeString.replace( "%p", zone );
+ dateTimeString.tqreplace( "%p", zone );
// minutes
if(time.minute() < 10)
{
- dateTimeString.replace( "%M", "0"+TQString::number( time.minute() ) );
+ dateTimeString.tqreplace( "%M", "0"+TQString::number( time.minute() ) );
}
else
{
- dateTimeString.replace( "%M", TQString::number( time.minute() ) );
+ dateTimeString.tqreplace( "%M", TQString::number( time.minute() ) );
}
// seconds
if(time.second() < 10)
{
- dateTimeString.replace( "%S", "0"+TQString::number( time.second() ) );
+ dateTimeString.tqreplace( "%S", "0"+TQString::number( time.second() ) );
}
else
{
- dateTimeString.replace( "%S", TQString::number( time.second() ) );
+ dateTimeString.tqreplace( "%S", TQString::number( time.second() ) );
}
// timezone
- dateTimeString.replace( "%Z", d->_project->identitySettings().timeZone );
+ dateTimeString.tqreplace( "%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.replace( "%z", ( offset < 0 ? "-" : "+" ) + t.toString("hhmm") );
+ dateTimeString.tqreplace( "%z", ( offset < 0 ? "-" : "+" ) + t.toString("hhmm") );
break;
}
}
@@ -1936,7 +1936,7 @@ TQString Catalog::dateTime() const
}
-ConversionStatus Catalog::saveFile()
+ConversiontqStatus Catalog::saveFile()
{
if(d->_url.isEmpty())
{
@@ -1947,11 +1947,11 @@ ConversionStatus Catalog::saveFile()
return saveFileAs(d->_url,true);
}
-ConversionStatus Catalog::saveFileAs(const KURL &url, bool overwrite)
+ConversiontqStatus Catalog::saveFileAs(const KURL &url, bool overwrite)
{
if( d->_active ) return BUSY;
- ConversionStatus status=OK;
+ ConversiontqStatus status=OK;
bool newName=false;
KURL targetURL=d->_url;
@@ -2036,14 +2036,14 @@ TQString Catalog::saveTempFile()
TQString filename = kapp->tempSaveName("/temp/kbabel_temp.po");
if( writeFile(filename) != OK )
{
- filename = TQString::null;
+ filename = TQString();
}
return filename;
}
-ConversionStatus Catalog::writeFile(TQString localFile , bool overwrite)
+ConversiontqStatus Catalog::writeFile(TQString localFile , bool overwrite)
{
TQFileInfo info(localFile);
@@ -2066,7 +2066,7 @@ ConversionStatus Catalog::writeFile(TQString localFile , bool overwrite)
}
}
- ConversionStatus error = OK;
+ ConversiontqStatus error = OK;
CatalogExportPlugin* filter=0;
// gimme plugin for this MIME type
@@ -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).contains(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*.+\\s*$")))
+ if((*it).tqcontains(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*.+\\s*$")))
{
- info.project=(*it).replace(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*"),"");
+ info.project=(*it).tqreplace(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).contains(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*.+\\s*$")))
+ else if((*it).tqcontains(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*.+\\s*$")))
{
- info.creation=(*it).replace(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*"),"");
+ info.creation=(*it).tqreplace(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).contains(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*.+\\s*$")))
+ else if((*it).tqcontains(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*.+\\s*$")))
{
- info.revision=(*it).replace(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*"),"");
+ info.revision=(*it).tqreplace(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).contains(TQRegExp("^\\s*Last-Translator\\s*:\\s*.+\\s*$")))
+ else if((*it).tqcontains(TQRegExp("^\\s*Last-Translator\\s*:\\s*.+\\s*$")))
{
- info.lastTranslator=(*it).replace(TQRegExp("^\\s*Last-Translator\\s*:\\s*"),"");
+ info.lastTranslator=(*it).tqreplace(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).contains(TQRegExp("^\\s*Language-Team\\s*:\\s*.+\\s*")))
+ else if((*it).tqcontains(TQRegExp("^\\s*Language-Team\\s*:\\s*.+\\s*")))
{
- info.languageTeam=(*it).replace(TQRegExp("^\\s*Language-Team\\s*:\\s*"),"");
+ info.languageTeam=(*it).tqreplace(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).contains(TQRegExp("^\\s*MIME-Version\\s*:\\s*.+\\s*")))
+ else if((*it).tqcontains(TQRegExp("^\\s*MIME-Version\\s*:\\s*.+\\s*")))
{
- info.mimeVersion=(*it).replace(TQRegExp("^\\s*MIME-Version\\s*:\\s*"),"");
+ info.mimeVersion=(*it).tqreplace(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).contains(TQRegExp("^\\s*Content-Type\\s*:\\s*.+\\s*")))
+ else if((*it).tqcontains(TQRegExp("^\\s*Content-Type\\s*:\\s*.+\\s*")))
{
- info.contentType=(*it).replace(TQRegExp("^\\s*Content-Type\\s*:\\s*"),"");
+ info.contentType=(*it).tqreplace(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).contains(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*.+\\s*")))
+ else if((*it).tqcontains(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*.+\\s*")))
{
- info.encoding=(*it).replace(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*"),"");
+ info.encoding=(*it).tqreplace(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.contains(miscOptions.accelMarker))
+ && targetStr.tqcontains(miscOptions.accelMarker))
{
- accelMarkerPos = targetStr.find(miscOptions.accelMarker);
+ accelMarkerPos = targetStr.tqfind(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.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(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.find(searchStr,docPos.offset,findOpts->caseSensitive)) >= 0 ) {
+ if( (pos=targetStr.tqfind(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.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(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.contains(miscOptions.accelMarker))
+ && targetStr.tqcontains(miscOptions.accelMarker))
{
- accelMarkerPos = targetStr.find(miscOptions.accelMarker);
+ accelMarkerPos = targetStr.tqfind(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.findRev(regexp,docPos.offset)) >= 0 ) {
+ if((pos=targetStr.tqfindRev(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.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(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.findRev(searchStr,docPos.offset-1,findOpts->caseSensitive)) >= 0
+ else if( (pos=targetStr.tqfindRev(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.contains(TQRegExp("[a-zA-Z0-9]")) && !post.contains(TQRegExp("[a-zA-Z0-9]")) ){
+ if(!pre.tqcontains(TQRegExp("[a-zA-Z0-9]")) && !post.tqcontains(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.replace( "\n","");
- if(d->msgidDiffList.contains(id))
+ id.tqreplace( "\n","");
+ if(d->msgidDiffList.tqcontains(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.replace("\n","");
- if(d->msgstr2MsgidDiffList.contains(str))
+ str.tqreplace("\n","");
+ if(d->msgstr2MsgidDiffList.tqcontains(str))
{
TQStringList list = d->msgstr2MsgidDiffList[str];
@@ -3134,7 +3134,7 @@ Catalog::DiffResult Catalog::diff(uint entry, TQString *result)
int counter=0;
int oldPercent=0;
- int max = QMAX( d->msgidDiffList.count()-1, 1);
+ int max = TQMAX( d->msgidDiffList.count()-1, 1);
TQStringList::ConstIterator it;
for(it = d->msgidDiffList.begin();
@@ -3193,7 +3193,7 @@ Catalog::DiffResult Catalog::diff(uint entry, TQString *result)
TQString r = wordDiff(idForDiff,id);
//esp for plural forms
- *result = r.replace("\\n<KBABELADD>" + TQString(TQChar(0x00B6)) + "</KBABELADD>", "\\n\n");
+ *result = r.tqreplace("\\n<KBABELADD>" + TQString(TQChar(0x00B6)) + "</KBABELADD>", "\\n\n");
s = new TQString(*result);
if( !d->diffCache.insert(entry,s) )
@@ -3220,7 +3220,7 @@ void Catalog::setDiffList( const TQValueList<DiffEntry>& list)
d->msgstr2MsgidDiffList.clear();
d->diffCache.clear();
- uint max = QMAX(list.count()-1,1);
+ uint max = TQMAX(list.count()-1,1);
int oldPercent=0;
uint counter=0;
TQValueList<DiffEntry>::ConstIterator it;
@@ -3236,14 +3236,14 @@ void Catalog::setDiffList( const TQValueList<DiffEntry>& list)
}
TQString id = (*it).msgid;
- id.replace("\n","");
+ id.tqreplace("\n","");
TQString str = (*it).msgstr;
- str.replace("\n","");
+ str.tqreplace("\n","");
d->msgidDiffList.append(id);
if(!str.isEmpty())
{
- if(d->msgstr2MsgidDiffList.contains(str))
+ if(d->msgstr2MsgidDiffList.tqcontains(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; replace-tabs on;
+// kate: space-indent on; indent-width 4; tqreplace-tabs on;