summaryrefslogtreecommitdiffstats
path: root/kbabel/common/catalog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kbabel/common/catalog.cpp')
-rw-r--r--kbabel/common/catalog.cpp570
1 files changed, 285 insertions, 285 deletions
diff --git a/kbabel/common/catalog.cpp b/kbabel/common/catalog.cpp
index ffd939b7..d6501c3e 100644
--- a/kbabel/common/catalog.cpp
+++ b/kbabel/common/catalog.cpp
@@ -31,14 +31,14 @@
your version.
**************************************************************************** */
-#include <qtextstream.h>
-#include <qfile.h>
-#include <qdir.h>
-#include <qfileinfo.h>
-#include <qregexp.h>
-#include <qstring.h>
-#include <qtextcodec.h>
-#include <qdatetime.h>
+#include <tqtextstream.h>
+#include <tqfile.h>
+#include <tqdir.h>
+#include <tqfileinfo.h>
+#include <tqregexp.h>
+#include <tqstring.h>
+#include <tqtextcodec.h>
+#include <tqdatetime.h>
#include <kconfig.h>
#include <kdatatool.h>
@@ -70,8 +70,8 @@
#include <kmessagebox.h>
using namespace KBabel;
-Catalog::Catalog(QObject* parent, const char* name, QString projectFile)
- : QObject(parent,name)
+Catalog::Catalog(TQObject* parent, const char* name, TQString projectFile)
+ : TQObject(parent,name)
{
if ( projectFile.isEmpty() )
projectFile = KBabel::ProjectManager::defaultProjectName();
@@ -79,7 +79,7 @@ Catalog::Catalog(QObject* parent, const char* name, QString projectFile)
readPreferences();
}
-Catalog::Catalog(const Catalog& c): QObject(c.parent(),c.name()
+Catalog::Catalog(const Catalog& c): TQObject(c.parent(),c.name()
)
{
kdFatal() << "Copy constructor of Catalog, please report how to reproduce to the authors" << endl;
@@ -90,20 +90,20 @@ Catalog::~Catalog()
delete d;
}
-QString Catalog::msgctxt(uint index) const
+TQString Catalog::msgctxt(uint index) const
{
if ( d->_entries.isEmpty() )
- return QString::null;
+ return TQString::null;
uint max=d->_entries.count()-1;
if(index > max)
index=max;
return d->_entries[index].msgctxt();
}
-QStringList Catalog::msgid(uint index, const bool noNewlines) const
+TQStringList Catalog::msgid(uint index, const bool noNewlines) const
{
if ( d->_entries.isEmpty() )
- return QString::null;
+ return TQString::null;
uint max=d->_entries.count()-1;
if(index > max)
index=max;
@@ -111,10 +111,10 @@ QStringList Catalog::msgid(uint index, const bool noNewlines) const
return d->_entries[index].msgid(noNewlines);
}
-QStringList Catalog::msgstr(uint index, const bool noNewlines) const
+TQStringList Catalog::msgstr(uint index, const bool noNewlines) const
{
if ( d->_entries.isEmpty() )
- return QString::null;
+ return TQString::null;
uint max=d->_entries.count()-1;
if(index > max)
@@ -123,24 +123,24 @@ QStringList Catalog::msgstr(uint index, const bool noNewlines) const
return d->_entries[index].msgstr(noNewlines);
}
-QString Catalog::comment(uint index) const
+TQString Catalog::comment(uint index) const
{
if ( d->_entries.isEmpty() )
- return QString::null;
+ return TQString::null;
uint max=d->_entries.count()-1;
if(index > max)
index=max;
return d->_entries[index].comment();
}
-QString Catalog::context(uint index) const
+TQString Catalog::context(uint index) const
{
- QString c = comment(index);
+ TQString c = comment(index);
- QStringList lines = QStringList::split("\n",c);
+ TQStringList lines = TQStringList::split("\n",c);
- QString result;
- for( QStringList::Iterator it=lines.begin(); it!=lines.end(); ++it)
+ TQString result;
+ for( TQStringList::Iterator it=lines.begin(); it!=lines.end(); ++it)
{
if( (*it).startsWith( "#:") )
{
@@ -155,15 +155,15 @@ CatalogItem Catalog::header() const
return d->_header;
}
-QString Catalog::lastTranslator() const
+TQString Catalog::lastTranslator() const
{
return headerInfo( d->_header ).lastTranslator;
}
-int Catalog::indexForMsgid(const QString& id) const
+int Catalog::indexForMsgid(const TQString& id) const
{
int i=0;
- QValueVector<CatalogItem>::ConstIterator it = d->_entries.begin();
+ TQValueVector<CatalogItem>::ConstIterator it = d->_entries.begin();
while(it != d->_entries.end() && !((*it).msgid(true).contains(id)))
{
@@ -177,10 +177,10 @@ int Catalog::indexForMsgid(const QString& id) const
return i;
}
-QStringList Catalog::tagList(uint index)
+TQStringList Catalog::tagList(uint index)
{
if ( d->_entries.isEmpty() )
- return QStringList();
+ return TQStringList();
uint max=d->_entries.count()-1;
if(index > max)
@@ -190,10 +190,10 @@ QStringList Catalog::tagList(uint index)
}
-QStringList Catalog::argList(uint index)
+TQStringList Catalog::argList(uint index)
{
if ( d->_entries.isEmpty() )
- return QStringList();
+ return TQStringList();
uint max=d->_entries.count()-1;
if(index > max)
@@ -204,7 +204,7 @@ QStringList Catalog::argList(uint index)
/*
-bool Catalog::setMsgstr(uint index,QString msgstr)
+bool Catalog::setMsgstr(uint index,TQString msgstr)
{
kdWarning() << "Catalog::setMsgstr()" << endl;
@@ -217,7 +217,7 @@ bool Catalog::setMsgstr(uint index,QString msgstr)
}
else if(msgstr.isEmpty())
{
- QValueList<uint>::Iterator it;
+ TQValueList<uint>::Iterator it;
// insert index in the right place in the list
it = _untransIndex.begin();
@@ -242,7 +242,7 @@ bool Catalog::setMsgstr(uint index,QString msgstr)
*/
/*
-bool Catalog::setComment(uint index,QString comment)
+bool Catalog::setComment(uint index,TQString comment)
{
kdWarning() << "Catalog::setComment()" << endl;
bool fuzziesChanged=false;
@@ -261,7 +261,7 @@ bool Catalog::setComment(uint index,QString comment)
}
else if(isFuzzy)
{
- QValueList<uint>::Iterator it;
+ TQValueList<uint>::Iterator it;
// insert index in the right place in the list
it = _fuzzyIndex.begin();
@@ -289,7 +289,7 @@ bool Catalog::setHeader(CatalogItem newHeader)
if(newHeader.isValid())
{
// normalize the values - ensure every key:value pair is only on a single line
- QString values = newHeader.msgstr().first();
+ TQString values = newHeader.msgstr().first();
values.replace ("\n", "");
values.replace ("\\n", "\\n\n");
@@ -321,11 +321,11 @@ void Catalog::setCurrentURL(const KURL& url)
CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
{
- QStringList headerList=oldHeader.msgstrAsList();
- QStringList commentList=QStringList::split('\n',oldHeader.comment());
+ TQStringList headerList=oldHeader.msgstrAsList();
+ TQStringList commentList=TQStringList::split('\n',oldHeader.comment());
- QStringList::Iterator it,ait;
- QString temp;
+ TQStringList::Iterator it,ait;
+ TQString temp;
bool found;
const IdentitySettings identityOptions = identitySettings();
@@ -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(QRegExp("^ *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).contains(QRegExp("^ *PO-Revision-Date:.*")))
+ if((*it).contains(TQRegExp("^ *PO-Revision-Date:.*")))
{
(*it) = temp;
found=true;
@@ -384,7 +384,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).contains(QRegExp("^ *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).contains(QRegExp("^ *Language-Team:.*")))
+ if((*it).contains(TQRegExp("^ *Language-Team:.*")))
{
(*it) = temp;
found=true;
@@ -425,7 +425,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
found=false;
- QString encodingStr;
+ TQString encodingStr;
if(saveOptions.useOldEncoding && d->fileCodec)
{
encodingStr = charsetString(d->fileCodec);
@@ -440,7 +440,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
it = headerList.begin();
while( it != headerList.end() )
{
- if( (*it).find( QRegExp( "^ *Content-Type:.*" ) ) != -1 )
+ if( (*it).find( TQRegExp( "^ *Content-Type:.*" ) ) != -1 )
{
if ( found )
{
@@ -450,8 +450,8 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
else
{
found=true;
- QRegExp regexp( "^ *Content-Type:(.*/.*);?\\s*charset=.*$" );
- QString mimeType;
+ TQRegExp regexp( "^ *Content-Type:(.*/.*);?\\s*charset=.*$" );
+ TQString mimeType;
if ( regexp.search( *it ) )
{
mimeType = regexp.cap( 1 ).stripWhiteSpace();
@@ -483,7 +483,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
for( it = headerList.begin(); it != headerList.end(); ++it )
{
- if((*it).contains(QRegExp("^ *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).contains(QRegExp("^ *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).contains(QRegExp("^ *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).contains(QRegExp("^ *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).find( QRegExp("^# *Copyright (\\(C\\)|\\x00a9).*Free Software Foundation, Inc") ) != -1 )
+ if ( (*it).find( TQRegExp("^# *Copyright (\\(C\\)|\\x00a9).*Free Software Foundation, Inc") ) != -1 )
{
found=true;
break;
@@ -572,27 +572,27 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
}
if(found)
{
- if ( (*it).find( QRegExp("^# *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).replace("YEAR", QDate::currentDate().toString("yyyy"));
+ (*it).replace("YEAR", TQDate::currentDate().toString("yyyy"));
} else
if( saveOptions.FSFCopyright == ProjectSettingsBase::Update )
{
//update years
- QString cy = QDate::currentDate().toString("yyyy");
- if( !(*it).contains( QRegExp(cy)) ) // is the year already included?
+ TQString cy = TQDate::currentDate().toString("yyyy");
+ if( !(*it).contains( TQRegExp(cy)) ) // is the year already included?
{
- int index = (*it).findRev( QRegExp("[\\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. "
"It will not be updated."));
} else {
- (*it).insert(index+1, QString(", ")+cy);
+ (*it).insert(index+1, TQString(", ")+cy);
}
}
}
@@ -608,14 +608,14 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
temp = temp.stripWhiteSpace();
// The description strings has often buggy variants already in the file, these must be removed
- QString regexpstr = "^#\\s+" + QRegExp::escape( saveOptions.descriptionString.stripWhiteSpace() ) + "\\s*$";
+ TQString regexpstr = "^#\\s+" + TQRegExp::escape( saveOptions.descriptionString.stripWhiteSpace() ) + "\\s*$";
regexpstr.replace( "@PACKAGE@", ".*" );
regexpstr.replace( "@LANGUAGE@", ".*" );
//kdDebug() << "REGEXPSTR: " << regexpstr << endl;
- QRegExp regexp ( regexpstr );
+ TQRegExp regexp ( regexpstr );
// The buggy variants exist in English too (of a time before KBabel got a translation for the corresponding language)
- QRegExp regexpUntranslated ( "^#\\s+Translation of .* into .*\\s*$" );
+ TQRegExp regexpUntranslated ( "^#\\s+Translation of .* into .*\\s*$" );
kdDebug () << "Temp is '" << temp << "'" << endl;
@@ -666,7 +666,7 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
&& ( ! identityOptions.authorName.isEmpty() )
&& ( ! identityOptions.authorEmail.isEmpty() ) ) // An email address can be used as ersatz of a name
{
- QStringList foundAuthors;
+ TQStringList foundAuthors;
temp = "# ";
temp += identityOptions.authorName;
@@ -674,11 +674,11 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
{
temp+=(" <"+identityOptions.authorEmail+">");
}
- temp+=", "+QDate::currentDate().toString("yyyy")+".";
+ temp+=", "+TQDate::currentDate().toString("yyyy")+".";
// ### TODO: it would be nice if the entry could start with "COPYRIGHT" and have the "(C)" symbol (both not mandatory)
- QRegExp regexpAuthorYear( "^#.*(<.+@.+>)?,\\s*([\\d]+[\\d\\-, ]*|YEAR)" );
- QRegExp regexpYearAlone( "^# , \\d{4}.?\\s*$" );
+ TQRegExp regexpAuthorYear( "^#.*(<.+@.+>)?,\\s*([\\d]+[\\d\\-, ]*|YEAR)" );
+ TQRegExp regexpYearAlone( "^# , \\d{4}.?\\s*$" );
it = commentList.begin();
while ( it != commentList.end() )
{
@@ -721,14 +721,14 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
found = false;
bool foundAuthor = false;
- const QString cy = QDate::currentDate().toString("yyyy");
+ const TQString cy = TQDate::currentDate().toString("yyyy");
ait = foundAuthors.end();
for( it = foundAuthors.begin() ; it!=foundAuthors.end(); ++it )
{
- if ( (*it).find( QRegExp(
- QRegExp::escape( identityOptions.authorName )+".*"
- + QRegExp::escape( identityOptions.authorEmail ) ) ) != -1 )
+ if ( (*it).find( TQRegExp(
+ TQRegExp::escape( identityOptions.authorName )+".*"
+ + TQRegExp::escape( identityOptions.authorEmail ) ) ) != -1 )
{
foundAuthor = true;
if( (*it).find( cy ) != -1 )
@@ -744,11 +744,11 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
else if ( ait != foundAuthors.end() )
{
//update years
- const int index = (*ait).findRev( QRegExp("[\\d]+[\\d\\-, ]*") );
+ const int index = (*ait).findRev( TQRegExp("[\\d]+[\\d\\-, ]*") );
if ( index == -1 )
(*ait)+=", "+cy;
else
- (*ait).insert(index+1, QString(", ")+cy);
+ (*ait).insert(index+1, TQString(", ")+cy);
}
else
kdDebug() << "INTERNAL ERROR: author found but iterator dangling!" << endl;
@@ -760,11 +760,11 @@ CatalogItem Catalog::updatedHeader(CatalogItem oldHeader, bool usePrefs) const
it=commentList.end();
do
--it;
- while( ( it != commentList.begin() ) && ( (*it).find( QRegExp( "^#(\\s*$|[:,\\.])" ) ) == -1 ) );
+ while( ( it != commentList.begin() ) && ( (*it).find( TQRegExp( "^#(\\s*$|[:,\\.])" ) ) == -1 ) );
++it;
for( ait = foundAuthors.begin() ; ait != foundAuthors.end() ; ++ait )
{
- QString s = (*ait);
+ TQString s = (*ait);
// ensure dot at the end of copyright
if( !s.endsWith(".") ) s += ".";
@@ -790,7 +790,7 @@ void Catalog::setFuzzy(uint index, bool on)
{
applyBeginCommand( index, Comment, 0 );
- QPtrList<EditCommand> editList;
+ TQPtrList<EditCommand> editList;
if(on)
{
editList=d->_entries[index].addFuzzy(false);
@@ -832,13 +832,13 @@ void Catalog::setModified(bool flag)
}
-QString Catalog::packageName() const
+TQString Catalog::packageName() const
{
if( !d->_packageName.isNull() ) return d->_packageName;
- QString package=d->_url.fileName();
+ TQString package=d->_url.fileName();
- int index=package.find(QRegExp("(\\."+identitySettings().languageCode+")?\\.pot?$"));
+ int index=package.find(TQRegExp("(\\."+identitySettings().languageCode+")?\\.pot?$"));
if(index>0)
package=package.left(index);
@@ -846,12 +846,12 @@ QString Catalog::packageName() const
return package;
}
-void Catalog::setPackage(const QString& package )
+void Catalog::setPackage(const TQString& package )
{
const int pos = package.findRev( '/' );
if( pos < 0 )
{
- d->_packageDir = QString();
+ d->_packageDir = TQString();
d->_packageName = package;
}
else
@@ -862,20 +862,20 @@ void Catalog::setPackage(const QString& package )
kdDebug() << k_funcinfo << " " << package << " => " << d->_packageDir << " + " << d->_packageName << endl;
}
-QString Catalog::packageDir() const
+TQString Catalog::packageDir() const
{
- QString result;
+ TQString result;
if( !d->_packageDir.isNull() ) result=d->_packageDir;
else result=d->_url.directory(false);
return result;
}
-QString Catalog::encoding() const
+TQString Catalog::encoding() const
{
SaveSettings options = saveSettings();
- QString encodingStr;
+ TQString encodingStr;
if(options.useOldEncoding && d->fileCodec)
{
encodingStr = charsetString(d->fileCodec);
@@ -888,9 +888,9 @@ QString Catalog::encoding() const
return encodingStr;
}
-ConversionStatus Catalog::openURL(const KURL& url, const QString& package)
+ConversionStatus Catalog::openURL(const KURL& url, const TQString& package)
{
- QString target;
+ TQString target;
ConversionStatus error = OK;
if(KIO::NetAccess::download(url, target, NULL))
@@ -930,15 +930,15 @@ ConversionStatus Catalog::openURL(const KURL& url, const QString& package)
filter = static_cast<CatalogImportPlugin*>(factory->create(0, 0));
// provide progress bar indication
- connect( filter, SIGNAL( signalResetProgressBar(QString,int) ),
- this, SIGNAL( signalResetProgressBar(QString,int) ));
- connect( filter, SIGNAL( signalProgress(int) ),
- this, SIGNAL( signalProgress(int) ));
- connect( filter, SIGNAL( signalClearProgressBar() ),
- this, SIGNAL( signalClearProgressBar() ));
-
- connect( this, SIGNAL( signalStopActivity() ),
- filter, SLOT( stop() ));
+ connect( filter, TQT_SIGNAL( signalResetProgressBar(TQString,int) ),
+ this, TQT_SIGNAL( signalResetProgressBar(TQString,int) ));
+ connect( filter, TQT_SIGNAL( signalProgress(int) ),
+ this, TQT_SIGNAL( signalProgress(int) ));
+ connect( filter, TQT_SIGNAL( signalClearProgressBar() ),
+ this, TQT_SIGNAL( signalClearProgressBar() ));
+
+ connect( this, TQT_SIGNAL( signalStopActivity() ),
+ filter, TQT_SLOT( stop() ));
// load in the file (target is always local)
d->_active = true;
@@ -971,8 +971,8 @@ ConversionStatus Catalog::openURL(const KURL& url, const QString& package)
if( package.isEmpty() )
{
- d->_packageName=QString::null;
- d->_packageDir=QString::null;
+ d->_packageName=TQString::null;
+ d->_packageDir=TQString::null;
}
else setPackage(package);
@@ -992,9 +992,9 @@ ConversionStatus Catalog::openURL(const KURL& url, const QString& package)
}
}
-ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, const QString& package)
+ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, const TQString& package)
{
- QString target;
+ TQString target;
ConversionStatus error = OK;
if(KIO::NetAccess::download(openUrl, target, NULL))
@@ -1027,15 +1027,15 @@ ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, cons
filter = static_cast<CatalogImportPlugin*>(factory->create(0, 0));
// provide progress bar indication
- connect( filter, SIGNAL( signalResetProgressBar(QString,int) ),
- this, SIGNAL( signalResetProgressBar(QString,int) ));
- connect( filter, SIGNAL( signalProgress(int) ),
- this, SIGNAL( signalProgress(int) ));
- connect( filter, SIGNAL( signalClearProgressBar() ),
- this, SIGNAL( signalClearProgressBar() ));
+ connect( filter, TQT_SIGNAL( signalResetProgressBar(TQString,int) ),
+ this, TQT_SIGNAL( signalResetProgressBar(TQString,int) ));
+ connect( filter, TQT_SIGNAL( signalProgress(int) ),
+ this, TQT_SIGNAL( signalProgress(int) ));
+ connect( filter, TQT_SIGNAL( signalClearProgressBar() ),
+ this, TQT_SIGNAL( signalClearProgressBar() ));
- connect( this, SIGNAL( signalStopActivity() ),
- filter, SLOT( stop() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ),
+ filter, TQT_SLOT( stop() ));
// load in the file (target is always local)
d->_active = true;
@@ -1069,8 +1069,8 @@ ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, cons
d->_url = saveURL;
if( package.isEmpty() )
{
- d->_packageName=QString::null;
- d->_packageDir=QString::null;
+ d->_packageName=TQString::null;
+ d->_packageDir=TQString::null;
}
else setPackage(package);
@@ -1093,12 +1093,12 @@ ConversionStatus Catalog::openURL(const KURL& openUrl, const KURL& saveURL, cons
}
}
-Msgfmt::Status Catalog::checkSyntax(QString& output, bool clearErrors)
+Msgfmt::Status Catalog::checkSyntax(TQString& output, bool clearErrors)
{
if( !d->_mimeTypes.contains( "application/x-gettext" ) )
return Msgfmt::Unsupported;
- QString filename;
+ TQString filename;
bool tempFileUsed=false;
if(d->_url.isLocalFile() && !isModified())
@@ -1125,15 +1125,15 @@ Msgfmt::Status Catalog::checkSyntax(QString& output, bool clearErrors)
currentLine=d->_header.totalLines()+1;
// ### KDE4: return "lines" not "output"
- const QStringList lines = QStringList::split("\n",output);
- for ( QStringList::const_iterator it = lines.constBegin(); it != lines.constEnd(); ++it )
+ const TQStringList lines = TQStringList::split("\n",output);
+ for ( TQStringList::const_iterator it = lines.constBegin(); it != lines.constEnd(); ++it )
{
- if( (*it).find(QRegExp("^.+:\\d+:")) >= 0 )
+ if( (*it).find(TQRegExp("^.+:\\d+:")) >= 0 )
{
const int begin=(*it).find(":",0)+1;
const int end=(*it).find(":",begin);
- const QString line=(*it).mid(begin,end-begin);
+ const TQString line=(*it).mid(begin,end-begin);
while( line.toInt() > currentLine )
{
@@ -1158,14 +1158,14 @@ Msgfmt::Status Catalog::checkSyntax(QString& output, bool clearErrors)
}
if(tempFileUsed)
- QFile::remove(filename);
+ TQFile::remove(filename);
return result;
}
void Catalog::clearErrorList()
{
- QValueList<uint>::Iterator it;
+ TQValueList<uint>::Iterator it;
for(it = d->_errorIndex.begin(); it != d->_errorIndex.end(); ++it)
{
d->_entries[(*it)].setSyntaxError(false);
@@ -1185,10 +1185,10 @@ void Catalog::removeFromErrorList(uint index)
}
}
-QStringList Catalog::itemStatus(uint index, bool recheck, QPtrList<KDataTool> whatToCheck)
+TQStringList Catalog::itemStatus(uint index, bool recheck, TQPtrList<KDataTool> whatToCheck)
{
if ( d->_entries.isEmpty() )
- return QStringList();
+ return TQStringList();
uint max=d->_entries.count()-1;
if(index > max)
@@ -1207,10 +1207,10 @@ QStringList Catalog::itemStatus(uint index, bool recheck, QPtrList<KDataTool> wh
return item.errors();
}
-QStringList Catalog::itemStatus(uint index)
+TQStringList Catalog::itemStatus(uint index)
{
if ( d->_entries.isEmpty() )
- return QStringList();
+ return TQStringList();
uint max=d->_entries.count()-1;
if(index > max)
@@ -1229,14 +1229,14 @@ bool Catalog::checkUsingTool(KDataTool* tool, bool clearErrors)
kdDebug(KBABEL) << "checkUsingTool active" << endl;
d->_active=true;
d->_stop=false;
- connect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
int index = 0;
bool hasErrors=false;
emit signalResetProgressBar(i18n("validating file"),100);
- for ( QValueVector<CatalogItem>::Iterator it = d->_entries.begin();
+ for ( TQValueVector<CatalogItem>::Iterator it = d->_entries.begin();
it != d->_entries.end(); ++it, index++ )
{
if( !tool->run( "validate", (void*)(&(*it)), "CatalogItem", "application/x-kbabel-catalogitem" ))
@@ -1256,26 +1256,26 @@ bool Catalog::checkUsingTool(KDataTool* tool, bool clearErrors)
kdDebug(KBABEL) << "checkUsingTool not active" << endl;
d->_active=false;
d->_stop=false;
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
emit signalClearProgressBar();
return !hasErrors;
}
-void Catalog::modifyUsingTool(KDataTool* tool, const QString& command)
+void Catalog::modifyUsingTool(KDataTool* tool, const TQString& command)
{
kdDebug(KBABEL) << "modifyUsingTool active" << endl;
d->_active=true;
d->_stop=false;
- connect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
int index = 0;
bool modified = false;
emit signalResetProgressBar(i18n("applying tool"),100);
- for ( QValueVector<CatalogItem>::Iterator it = d->_entries.begin();
+ for ( TQValueVector<CatalogItem>::Iterator it = d->_entries.begin();
it != d->_entries.end(); ++it, index++ )
{
CatalogItem dummyItem( *it );
@@ -1294,7 +1294,7 @@ void Catalog::modifyUsingTool(KDataTool* tool, const QString& command)
{
uint in = 0; // number of current lural form
// go over all plural forms and test, which changed
- for ( QStringList::Iterator itorig = (*it).msgstr().begin()
+ for ( TQStringList::Iterator itorig = (*it).msgstr().begin()
, itchanged = dummyItem.msgstr().begin()
; itorig != (*it).msgstr().end()
; ++itorig, ++itchanged) {
@@ -1334,7 +1334,7 @@ void Catalog::modifyUsingTool(KDataTool* tool, const QString& command)
kdDebug(KBABEL) << "modifyUsingTool not active" << endl;
d->_active=false;
d->_stop=false;
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
emit signalClearProgressBar();
}
@@ -1653,7 +1653,7 @@ bool Catalog::isGeneratedFromDocbook() const
return d->_generatedFromDocbook;
}
-QString Catalog::package() const
+TQString Catalog::package() const
{
return packageDir()+packageName();
}
@@ -1672,7 +1672,7 @@ void Catalog::setSettings(IdentitySettings settings)
{
IdentitySettings oldsettings = d->_project->identitySettings();
- QString oldLanguageCode = oldsettings.languageCode;
+ TQString oldLanguageCode = oldsettings.languageCode;
int oldForms = oldsettings.numberOfPluralForms;
@@ -1711,7 +1711,7 @@ void Catalog::generateIndexLists()
clearErrorList();
uint counter=0;
- for ( QValueVector<CatalogItem>::Iterator it = d->_entries.begin(); it != d->_entries.end(); ++it )
+ for ( TQValueVector<CatalogItem>::Iterator it = d->_entries.begin(); it != d->_entries.end(); ++it )
{
if((*it).isUntranslated())
{
@@ -1727,9 +1727,9 @@ void Catalog::generateIndexLists()
}
-int Catalog::findNextInList(const QValueList<uint>& list,uint index) const
+int Catalog::findNextInList(const TQValueList<uint>& list,uint index) const
{
- QValueList<uint>::ConstIterator it;
+ TQValueList<uint>::ConstIterator it;
int nextIndex=-1;
@@ -1759,9 +1759,9 @@ int Catalog::findNextInList(const QValueList<uint>& list,uint index) const
return nextIndex;
}
-int Catalog::findPrevInList(const QValueList<uint>& list,uint index) const
+int Catalog::findPrevInList(const TQValueList<uint>& list,uint index) const
{
- QValueList<uint>::ConstIterator it;
+ TQValueList<uint>::ConstIterator it;
int prevIndex=-1;
@@ -1798,10 +1798,10 @@ int Catalog::findPrevInList(const QValueList<uint>& list,uint index) const
}
-QString Catalog::dateTime() const
+TQString Catalog::dateTime() const
{
- const QDateTime dt = QDateTime::currentDateTime();
- QString dateTimeString;
+ const TQDateTime dt = TQDateTime::currentDateTime();
+ TQString dateTimeString;
const SaveSettings options = d->_project->saveSettings();
@@ -1815,7 +1815,7 @@ QString Catalog::dateTime() const
case Qt::ISODate:
{
dateTimeString = dt.toString("yyyy-MM-dd hh:mm");
- QTime t;
+ TQTime t;
const int offset = KRFCDate::localUTCOffset();
const int correction = offset < 0 ? -60 : 60 ;
t = t.addSecs( offset * correction );
@@ -1827,56 +1827,56 @@ QString Catalog::dateTime() const
{
dateTimeString = options.customDateFormat;
- const QDate date = dt.date();
- const QTime time = dt.time();
+ const TQDate date = dt.date();
+ const TQTime time = dt.time();
// the year
- dateTimeString.replace( "%Y", QString::number( date.year() ) );
- dateTimeString.replace( "%y", QString::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.replace( "%m", "0"+QString::number( date.month() ) );
+ dateTimeString.replace( "%m", "0"+TQString::number( date.month() ) );
}
else
{
- dateTimeString.replace( "%m", QString::number( date.month() ) );
+ dateTimeString.replace( "%m", TQString::number( date.month() ) );
}
- dateTimeString.replace( "%f", QString::number( date.month() ) );
+ dateTimeString.replace( "%f", TQString::number( date.month() ) );
dateTimeString.replace( "%b", date.longMonthName(date.month()) );
dateTimeString.replace( "%h", date.longMonthName(date.month()) );
// the day
- dateTimeString.replace( "%j", QString::number( date.dayOfYear() ) );
- dateTimeString.replace( "%e", QString::number( date.day() ) );
+ dateTimeString.replace( "%j", TQString::number( date.dayOfYear() ) );
+ dateTimeString.replace( "%e", TQString::number( date.day() ) );
if(date.day() < 10)
{
- dateTimeString.replace( "%d", "0"+QString::number( date.day() ) );
+ dateTimeString.replace( "%d", "0"+TQString::number( date.day() ) );
}
else
{
- dateTimeString.replace( "%d", QString::number( date.day() ) );
+ dateTimeString.replace( "%d", TQString::number( date.day() ) );
}
dateTimeString.replace( "%a", date.longDayName( date.dayOfWeek() ) );
// hour
- dateTimeString.replace( "%k", QString::number( time.hour() ) );
+ dateTimeString.replace( "%k", TQString::number( time.hour() ) );
if(time.hour() < 10)
{
- dateTimeString.replace( "%H", "0"+QString::number( time.hour() ) );
+ dateTimeString.replace( "%H", "0"+TQString::number( time.hour() ) );
}
else
{
- dateTimeString.replace( "%H", QString::number( time.hour() ) );
+ dateTimeString.replace( "%H", TQString::number( time.hour() ) );
}
- QString zone; // AM or PM
+ TQString zone; // AM or PM
int hour = time.hour();
if( hour > 12 )
{
@@ -1888,15 +1888,15 @@ QString Catalog::dateTime() const
zone="AM";
}
- dateTimeString.replace( "%I", QString::number( hour ) );
+ dateTimeString.replace( "%I", TQString::number( hour ) );
if(hour < 10)
{
- dateTimeString.replace( "%i", "0"+QString::number( hour ) );
+ dateTimeString.replace( "%i", "0"+TQString::number( hour ) );
}
else
{
- dateTimeString.replace( "%i", QString::number( hour ) );
+ dateTimeString.replace( "%i", TQString::number( hour ) );
}
dateTimeString.replace( "%p", zone );
@@ -1904,26 +1904,26 @@ QString Catalog::dateTime() const
// minutes
if(time.minute() < 10)
{
- dateTimeString.replace( "%M", "0"+QString::number( time.minute() ) );
+ dateTimeString.replace( "%M", "0"+TQString::number( time.minute() ) );
}
else
{
- dateTimeString.replace( "%M", QString::number( time.minute() ) );
+ dateTimeString.replace( "%M", TQString::number( time.minute() ) );
}
// seconds
if(time.second() < 10)
{
- dateTimeString.replace( "%S", "0"+QString::number( time.second() ) );
+ dateTimeString.replace( "%S", "0"+TQString::number( time.second() ) );
}
else
{
- dateTimeString.replace( "%S", QString::number( time.second() ) );
+ dateTimeString.replace( "%S", TQString::number( time.second() ) );
}
// timezone
dateTimeString.replace( "%Z", d->_project->identitySettings().timeZone );
- QTime t;
+ TQTime t;
const int offset = KRFCDate::localUTCOffset();
const int correction = offset < 0 ? -60 : 60;
t = t.addSecs( offset * correction );
@@ -1973,15 +1973,15 @@ ConversionStatus Catalog::saveFileAs(const KURL &url, bool overwrite)
if(targetURL.isLocalFile())
{
// test if the directory exists. If not, create it.
- QDir dir( targetURL.directory());
+ TQDir dir( targetURL.directory());
- QStringList dirList;
+ TQStringList dirList;
while(!dir.exists() && !dir.dirName().isEmpty())
{
dirList.prepend(dir.dirName());
dir.setPath(dir.path()+"/..");
}
- for ( QStringList::Iterator it = dirList.begin(); it != dirList.end(); ++it )
+ for ( TQStringList::Iterator it = dirList.begin(); it != dirList.end(); ++it )
{
if(!dir.mkdir(*it))
{
@@ -1998,7 +1998,7 @@ ConversionStatus Catalog::saveFileAs(const KURL &url, bool overwrite)
}
else
{
- QString tempFile=kapp->tempSaveName(targetURL.path(0));
+ TQString tempFile=kapp->tempSaveName(targetURL.path(0));
status = writeFile(tempFile,overwrite);
@@ -2010,7 +2010,7 @@ ConversionStatus Catalog::saveFileAs(const KURL &url, bool overwrite)
}
}
- QFile::remove(tempFile);
+ TQFile::remove(tempFile);
}
if(status == OK)
@@ -2031,21 +2031,21 @@ ConversionStatus Catalog::saveFileAs(const KURL &url, bool overwrite)
return status;
}
-QString Catalog::saveTempFile()
+TQString Catalog::saveTempFile()
{
- QString filename = kapp->tempSaveName("/temp/kbabel_temp.po");
+ TQString filename = kapp->tempSaveName("/temp/kbabel_temp.po");
if( writeFile(filename) != OK )
{
- filename = QString::null;
+ filename = TQString::null;
}
return filename;
}
-ConversionStatus Catalog::writeFile(QString localFile , bool overwrite)
+ConversionStatus Catalog::writeFile(TQString localFile , bool overwrite)
{
- QFileInfo info(localFile);
+ TQFileInfo info(localFile);
if(info.isDir())
return NO_FILE;
@@ -2059,7 +2059,7 @@ ConversionStatus Catalog::writeFile(QString localFile , bool overwrite)
}
else // check if the directory is writable
{
- QFileInfo dir(info.dirPath());
+ TQFileInfo dir(info.dirPath());
if(!dir.isWritable())
{
return NO_PERMISSIONS;
@@ -2093,15 +2093,15 @@ ConversionStatus Catalog::writeFile(QString localFile , bool overwrite)
filter = static_cast<CatalogExportPlugin*>(factory->create(0, 0));
// provide progress bar indication
- connect( filter, SIGNAL( signalResetProgressBar(QString,int) ),
- this, SIGNAL( signalResetProgressBar(QString,int) ));
- connect( filter, SIGNAL( signalProgress(int) ),
- this, SIGNAL( signalProgress(int) ));
- connect( filter, SIGNAL( signalClearProgressBar() ),
- this, SIGNAL( signalClearProgressBar() ));
+ connect( filter, TQT_SIGNAL( signalResetProgressBar(TQString,int) ),
+ this, TQT_SIGNAL( signalResetProgressBar(TQString,int) ));
+ connect( filter, TQT_SIGNAL( signalProgress(int) ),
+ this, TQT_SIGNAL( signalProgress(int) ));
+ connect( filter, TQT_SIGNAL( signalClearProgressBar() ),
+ this, TQT_SIGNAL( signalClearProgressBar() ));
- connect( this, SIGNAL( signalStopActivity() ),
- filter, SLOT( stop() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ),
+ filter, TQT_SLOT( stop() ));
// load in the file (target is always local)
kdDebug(KBABEL) << "writeFile active" << endl;
@@ -2117,13 +2117,13 @@ ConversionStatus Catalog::writeFile(QString localFile , bool overwrite)
return error;
}
-QTextCodec* Catalog::codecForFile(QString gettextHeader)
+TQTextCodec* Catalog::codecForFile(TQString gettextHeader)
{
- QString charset;
+ TQString charset;
- QString head = gettextHeader;
+ TQString head = gettextHeader;
- QRegExp r("Content-Type:\\s*\\w+/[-\\w]+;?\\s*charset\\s*=\\s*[^\\\"\\n]+");
+ TQRegExp r("Content-Type:\\s*\\w+/[-\\w]+;?\\s*charset\\s*=\\s*[^\\\"\\n]+");
int begin=r.search(head);
int len=r.matchedLength();
if(begin<0) {
@@ -2133,13 +2133,13 @@ QTextCodec* Catalog::codecForFile(QString gettextHeader)
head = head.mid(begin,len);
- QRegExp regexp("charset *= *([^\\\\\\\"]+)");
+ TQRegExp regexp("charset *= *([^\\\\\\\"]+)");
if( regexp.search( head ) > -1 )
{
charset = regexp.cap(1);
}
- QTextCodec* codec=0;
+ TQTextCodec* codec=0;
if(!charset.isEmpty())
{
@@ -2148,20 +2148,20 @@ QTextCodec* Catalog::codecForFile(QString gettextHeader)
// at least utf8, so utf8-codec can be used for both.
if( charset == "CHARSET")
{
- codec=QTextCodec::codecForName("utf8");
+ codec=TQTextCodec::codecForName("utf8");
kdDebug(KBABEL)
- << QString("file seems to be a template: using utf8 encoding.")
+ << TQString("file seems to be a template: using utf8 encoding.")
<< endl;
}
else
{
- codec=QTextCodec::codecForName(charset.latin1());
+ codec=TQTextCodec::codecForName(charset.latin1());
}
if(!codec)
{
kdWarning() << "charset found, but no codec available, using UTF8 instead" << endl;
- codec=QTextCodec::codecForName("utf8");
+ codec=TQTextCodec::codecForName("utf8");
}
}
@@ -2170,81 +2170,81 @@ QTextCodec* Catalog::codecForFile(QString gettextHeader)
PoInfo Catalog::headerInfo(const CatalogItem headerItem)
{
- QStringList header=headerItem.msgstrAsList();
+ TQStringList header=headerItem.msgstrAsList();
- QStringList::Iterator it;
+ TQStringList::Iterator it;
PoInfo info;
// extract information from the header
for(it=header.begin();it!=header.end();++it)
{
- if((*it).contains(QRegExp("^\\s*Project-Id-Version\\s*:\\s*.+\\s*$")))
+ if((*it).contains(TQRegExp("^\\s*Project-Id-Version\\s*:\\s*.+\\s*$")))
{
- info.project=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*POT-Creation-Date\\s*:\\s*.+\\s*$")))
+ else if((*it).contains(TQRegExp("^\\s*POT-Creation-Date\\s*:\\s*.+\\s*$")))
{
- info.creation=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*PO-Revision-Date\\s*:\\s*.+\\s*$")))
+ else if((*it).contains(TQRegExp("^\\s*PO-Revision-Date\\s*:\\s*.+\\s*$")))
{
- info.revision=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*Last-Translator\\s*:\\s*.+\\s*$")))
+ else if((*it).contains(TQRegExp("^\\s*Last-Translator\\s*:\\s*.+\\s*$")))
{
- info.lastTranslator=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*Language-Team\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*Language-Team\\s*:\\s*.+\\s*")))
{
- info.languageTeam=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*MIME-Version\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*MIME-Version\\s*:\\s*.+\\s*")))
{
- info.mimeVersion=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*Content-Type\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*Content-Type\\s*:\\s*.+\\s*")))
{
- info.contentType=(*it).replace(QRegExp("^\\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).contains(QRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*.+\\s*")))
+ else if((*it).contains(TQRegExp("^\\s*Content-Transfer-Encoding\\s*:\\s*.+\\s*")))
{
- info.encoding=(*it).replace(QRegExp("^\\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);
@@ -2253,7 +2253,7 @@ PoInfo Catalog::headerInfo(const CatalogItem headerItem)
}
else
{
- QString line=(*it);
+ TQString line=(*it);
if(line.right(2)=="\\n")
line.remove(line.length()-2,2);
@@ -2455,7 +2455,7 @@ void Catalog::processCommand(EditCommand* cmd,CatalogView* view, bool undo)
if(checkUntranslated && item.isUntranslated())
{
- QValueList<uint>::Iterator it;
+ TQValueList<uint>::Iterator it;
// insert index in the right place in the list
it = d->_untransIndex.begin();
@@ -2478,7 +2478,7 @@ void Catalog::processCommand(EditCommand* cmd,CatalogView* view, bool undo)
}
else
{
- QValueList<uint>::Iterator it;
+ TQValueList<uint>::Iterator it;
// insert index in the right place in the list
it = d->_fuzzyIndex.begin();
@@ -2504,15 +2504,15 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
kdDebug(KBABEL) << "findNext active" << endl;
d->_active=true;
d->_stop=false;
- connect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
MiscSettings miscOptions = miscSettings();
len=0;
int pos=0;
- QString searchStr = findOpts->findStr;
- QRegExp regexp(searchStr);
+ TQString searchStr = findOpts->findStr;
+ TQRegExp regexp(searchStr);
if( findOpts->isRegExp ) {
regexp.setCaseSensitive(findOpts->caseSensitive);
@@ -2547,14 +2547,14 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
int accelMarkerPos = -1;
int contextInfoLength = 0;
int contextInfoPos = -1;
- QString targetStr;
+ TQString targetStr;
kapp->processEvents(10);
if( d->_stop || endReached)
{
kdDebug(KBABEL) << "FindNext: endReached or stopped" << endl;
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "findNext not active" << endl;
d->_active=false;
d->_stop=false;
@@ -2603,9 +2603,9 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
if ((pos=regexp.search(targetStr,docPos.offset)) >= 0 ) {
len = regexp.matchedLength();
if(findOpts->wholeWords) {
- QString pre=targetStr.mid(pos-1,1);
- QString post=targetStr.mid(pos+len,1);
- if(!pre.contains(QRegExp("[a-zA-Z0-9]")) && !post.contains(QRegExp("[a-zA-Z0-9]")) ){
+ 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]")) ){
success=true;
docPos.offset=pos;
}
@@ -2621,9 +2621,9 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
len=searchStr.length();
if(findOpts->wholeWords) {
- QString pre=targetStr.mid(pos-1,1);
- QString post=targetStr.mid(pos+len,1);
- if(!pre.contains(QRegExp("[a-zA-Z0-9]")) && !post.contains(QRegExp("[a-zA-Z0-9]")) ){
+ 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]")) ){
success=true;
docPos.offset=pos;
}
@@ -2763,7 +2763,7 @@ bool Catalog::findNext(const FindOptions* findOpts, DocPosition& docPos, int& le
}
}
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "findNext not active" << endl;
d->_active=false;
d->_stop=false;
@@ -2779,15 +2779,15 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
kdDebug(KBABEL) << "findPrev active" << endl;
d->_active=true;
d->_stop=false;
- connect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
MiscSettings miscOptions = miscSettings();
len=0;
int pos=0;
- QString searchStr = findOpts->findStr;
- QRegExp regexp(searchStr);
+ TQString searchStr = findOpts->findStr;
+ TQRegExp regexp(searchStr);
if( findOpts->isRegExp ) {
regexp.setCaseSensitive(findOpts->caseSensitive);
@@ -2796,14 +2796,14 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
int accelMarkerPos = -1;
int contextInfoLength = 0;
int contextInfoPos = -1;
- QString targetStr;
+ TQString targetStr;
kapp->processEvents(10);
if( d->_stop || beginReached)
{
kdDebug(KBABEL) << "FindNext: endReached or stopped" << endl;
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "findPrev active" << endl;
d->_active=false;
d->_stop=false;
@@ -2869,9 +2869,9 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
}
if(found) {
if(findOpts->wholeWords) {
- QString pre=targetStr.mid(pos-1,1);
- QString post=targetStr.mid(pos+len,1);
- if(!pre.contains(QRegExp("[a-zA-Z0-9]")) && !post.contains(QRegExp("[a-zA-Z0-9]")) ){
+ 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]")) ){
success=true;
docPos.offset=pos;
}
@@ -2886,9 +2886,9 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
&& (uint)pos < docPos.offset) {
len=searchStr.length();
if(findOpts->wholeWords) {
- QString pre=targetStr.mid(pos-1,1);
- QString post=targetStr.mid(pos+len,1);
- if(!pre.contains(QRegExp("[a-zA-Z0-9]")) && !post.contains(QRegExp("[a-zA-Z0-9]")) ){
+ 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]")) ){
success=true;
docPos.offset=pos;
}
@@ -3034,7 +3034,7 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
}
}
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "findPrev active" << endl;
d->_active=false;
d->_stop=false;
@@ -3043,7 +3043,7 @@ bool Catalog::findPrev(const FindOptions* findOpts, DocPosition& docPos, int& le
}
-Catalog::DiffResult Catalog::diff(uint entry, QString *result)
+Catalog::DiffResult Catalog::diff(uint entry, TQString *result)
{
if(!result)
{
@@ -3057,7 +3057,7 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
}
// first look if the diff for this entry is in the cache
- QString *s = d->diffCache[entry];
+ TQString *s = d->diffCache[entry];
if(s)
{
if(s->isEmpty())
@@ -3070,7 +3070,7 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
// then look if the same msgid is contained in the diff file
// FIXME: should care about plural forms in msgid
- QString id = msgid(entry).first();
+ TQString id = msgid(entry).first();
id.replace( "\n","");
if(d->msgidDiffList.contains(id))
{
@@ -3080,21 +3080,21 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
return DiffOk;
}
- connect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "diffv active" << endl;
d->_active=true;
d->_stop=false;
- QString idForDiff;
+ TQString idForDiff;
// then look if there are entries with the same translation
kdWarning() << "Diff feature (2) does not work with plural forms" << endl;
- QString str = msgstr(entry).first();
+ TQString str = msgstr(entry).first();
str.replace("\n","");
if(d->msgstr2MsgidDiffList.contains(str))
{
- QStringList list = d->msgstr2MsgidDiffList[str];
+ TQStringList list = d->msgstr2MsgidDiffList[str];
if(list.count() == 1)
{
@@ -3104,9 +3104,9 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
{
// find the best matching id
double bestWeight = 0.6;
- QString bestId;
+ TQString bestId;
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for(it = list.begin(); it != list.end(); ++it)
{
double weight = LevenshteinDistance()(id, (*it));
@@ -3130,13 +3130,13 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
// find the best matching id
double bestWeight = 0.6;
- QString bestId;
+ TQString bestId;
int counter=0;
int oldPercent=0;
int max = QMAX( d->msgidDiffList.count()-1, 1);
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
for(it = d->msgidDiffList.begin();
it != d->msgidDiffList.end(); ++it)
{
@@ -3159,7 +3159,7 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
if( d->_stop )
{
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug
(KBABEL) << "diffv not active" << endl;
@@ -3180,7 +3180,7 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
if( idForDiff.isEmpty() )
{
- s = new QString(*result);
+ s = new TQString(*result);
if( !d->diffCache.insert(entry,s) )
delete s;
@@ -3190,16 +3190,16 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
return DiffNotFound;
}
- QString r = wordDiff(idForDiff,id);
+ TQString r = wordDiff(idForDiff,id);
//esp for plural forms
- *result = r.replace("\\n<KBABELADD>" + QString(QChar(0x00B6)) + "</KBABELADD>", "\\n\n");
+ *result = r.replace("\\n<KBABELADD>" + TQString(TQChar(0x00B6)) + "</KBABELADD>", "\\n\n");
- s = new QString(*result);
+ s = new TQString(*result);
if( !d->diffCache.insert(entry,s) )
delete s;
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "diffv not active" << endl;
d->_active=false;
d->_stop=false;
@@ -3207,9 +3207,9 @@ Catalog::DiffResult Catalog::diff(uint entry, QString *result)
return DiffOk;
}
-void Catalog::setDiffList( const QValueList<DiffEntry>& list)
+void Catalog::setDiffList( const TQValueList<DiffEntry>& list)
{
- connect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ connect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "setDiffList active" << endl;
d->_active=true;
d->_stop=false;
@@ -3223,7 +3223,7 @@ void Catalog::setDiffList( const QValueList<DiffEntry>& list)
uint max = QMAX(list.count()-1,1);
int oldPercent=0;
uint counter=0;
- QValueList<DiffEntry>::ConstIterator it;
+ TQValueList<DiffEntry>::ConstIterator it;
for(it = list.begin(); it != list.end(); ++it)
{
int percent = (100*counter)/max;
@@ -3235,9 +3235,9 @@ void Catalog::setDiffList( const QValueList<DiffEntry>& list)
kapp->processEvents(10);
}
- QString id = (*it).msgid;
+ TQString id = (*it).msgid;
id.replace("\n","");
- QString str = (*it).msgstr;
+ TQString str = (*it).msgstr;
str.replace("\n","");
d->msgidDiffList.append(id);
@@ -3245,12 +3245,12 @@ void Catalog::setDiffList( const QValueList<DiffEntry>& list)
{
if(d->msgstr2MsgidDiffList.contains(str))
{
- QStringList sl = d->msgstr2MsgidDiffList[str];
+ TQStringList sl = d->msgstr2MsgidDiffList[str];
sl.append(id);
}
else
{
- QStringList sl;
+ TQStringList sl;
sl.append(id);
d->msgstr2MsgidDiffList.insert(str,sl);
}
@@ -3259,17 +3259,17 @@ void Catalog::setDiffList( const QValueList<DiffEntry>& list)
emit signalClearProgressBar();
- disconnect( this, SIGNAL( signalStopActivity() ), this, SLOT( stopInternal() ));
+ disconnect( this, TQT_SIGNAL( signalStopActivity() ), this, TQT_SLOT( stopInternal() ));
kdDebug(KBABEL) << "setDiffList not active" << endl;
d->_active=false;
d->_stop=false;
}
-QValueList<DiffEntry> Catalog::asDiffList()
+TQValueList<DiffEntry> Catalog::asDiffList()
{
- QValueList<DiffEntry> list;
+ TQValueList<DiffEntry> list;
- for ( QValueVector<CatalogItem>::Iterator it = d->_entries.begin();
+ for ( TQValueVector<CatalogItem>::Iterator it = d->_entries.begin();
it != d->_entries.end(); ++it)
{
DiffEntry e;
@@ -3299,7 +3299,7 @@ void Catalog::getNumberOfPluralForms()
return;
}
- QString lang=options.languageCode;
+ TQString lang=options.languageCode;
if(lang.isEmpty())
{
d->numberOfPluralForms=-1;
@@ -3309,7 +3309,7 @@ void Catalog::getNumberOfPluralForms()
d->numberOfPluralForms = getNumberOfPluralForms(lang);
}
-int Catalog::getNumberOfPluralForms(const QString& lang)
+int Catalog::getNumberOfPluralForms(const TQString& lang)
{
int nr=-1;
@@ -3323,7 +3323,7 @@ int Catalog::getNumberOfPluralForms(const QString& lang)
"that out if unsure, the programs will crash!!\n"
"Definition of PluralForm - to be set by the translator of kdelibs.po";
- QString formsTranslation = locale.translate(formsString);
+ TQString formsTranslation = locale.translate(formsString);
// no translation found
if(formsTranslation == formsString || formsTranslation.isEmpty())
@@ -3385,44 +3385,44 @@ bool Catalog::isModified() const
return d->_modified;
}
-void Catalog::setEntries(QValueVector<CatalogItem> entries)
+void Catalog::setEntries(TQValueVector<CatalogItem> entries)
{
d->_entries=entries;
// update the project for entries
- for ( QValueVector<CatalogItem>::Iterator it = d->_entries.begin();
+ for ( TQValueVector<CatalogItem>::Iterator it = d->_entries.begin();
it != d->_entries.end(); ++it)
{
it->setProject( d->_project );
}
}
-void Catalog::setObsoleteEntries(QValueList<CatalogItem> entries)
+void Catalog::setObsoleteEntries(TQValueList<CatalogItem> entries)
{
d->_obsoleteEntries=entries;
}
-QValueList<CatalogItem> Catalog::obsoleteEntries() const
+TQValueList<CatalogItem> Catalog::obsoleteEntries() const
{
return d->_obsoleteEntries;
}
-void Catalog::setCatalogExtraData(const QStringList& data)
+void Catalog::setCatalogExtraData(const TQStringList& data)
{
d->_catalogExtra = data;
}
-QStringList Catalog::catalogExtraData() const
+TQStringList Catalog::catalogExtraData() const
{
return d->_catalogExtra;
}
-QString Catalog::importPluginID() const
+TQString Catalog::importPluginID() const
{
return d->_importID;
}
-QTextCodec* Catalog::fileCodec() const
+TQTextCodec* Catalog::fileCodec() const
{
return d->fileCodec;
}
@@ -3432,17 +3432,17 @@ void Catalog::setGeneratedFromDocbook(const bool generated)
d->_generatedFromDocbook = generated;
}
-void Catalog::setFileCodec( QTextCodec* codec )
+void Catalog::setFileCodec( TQTextCodec* codec )
{
d->fileCodec = codec;
}
-void Catalog::setErrorIndex( const QValueList<uint>& list )
+void Catalog::setErrorIndex( const TQValueList<uint>& list )
{
d->_errorIndex = list;
}
-void Catalog::setImportPluginID( const QString& id )
+void Catalog::setImportPluginID( const TQString& id )
{
d->_importID = id;
}
@@ -3463,12 +3463,12 @@ bool Catalog::isActive()
return d->_active;
}
-void Catalog::setMimeTypes( const QString& mimeTypes )
+void Catalog::setMimeTypes( const TQString& mimeTypes )
{
d->_mimeTypes = mimeTypes;
}
-QString Catalog::mimeTypes() const
+TQString Catalog::mimeTypes() const
{
return d->_mimeTypes;
}
@@ -3479,21 +3479,21 @@ void Catalog::wordCount (uint &total, uint &fuzzy, uint &untranslated) const
fuzzy = 0;
untranslated = 0;
- QRegExp separator( "[ \n\t]+" );
+ TQRegExp separator( "[ \n\t]+" );
- for ( QValueVector<CatalogItem>::Iterator it = d->_entries.begin();
+ for ( TQValueVector<CatalogItem>::Iterator it = d->_entries.begin();
it != d->_entries.end(); ++it)
{
// find out the number of words for this message
// join all forms together
- QString message = (*it).msgid ().join (" ");
+ TQString message = (*it).msgid ().join (" ");
// remove tags first
d->_tagExtractor->setString( message );
message = d->_tagExtractor->plainString(false);
- QStringList words = QStringList::split ( separator, message );
+ TQStringList words = TQStringList::split ( separator, message );
total += words.count();