diff options
Diffstat (limited to 'kbabel/common')
37 files changed, 904 insertions, 904 deletions
diff --git a/kbabel/common/argextractor.cpp b/kbabel/common/argextractor.cpp index 4146a5a7..ec5d659f 100644 --- a/kbabel/common/argextractor.cpp +++ b/kbabel/common/argextractor.cpp @@ -37,22 +37,22 @@ #include <kdebug.h> #include <kstaticdeleter.h> -#include <qregexp.h> +#include <tqregexp.h> using namespace KBabel; -ArgExtractor::ArgExtractor(QString string) : RegExpExtractor( string ) +ArgExtractor::ArgExtractor(TQString string) : RegExpExtractor( string ) { } -QStringList *ArgExtractor::_argList=0; -KStaticDeleter< QStringList > sdAL; +TQStringList *ArgExtractor::_argList=0; +KStaticDeleter< TQStringList > sdAL; -QStringList *ArgExtractor::regExpList() +TQStringList *ArgExtractor::regExpList() { if(!_argList) { - sdAL.setObject( _argList, new QStringList ); + sdAL.setObject( _argList, new TQStringList ); //Build the default arg list _argList->append("%[ndioxXucsfeEgGp]"); _argList->append("%([0-9]+(\\$))?[-+'#0]?[0-9]*(.[0-9]+)?[hlL]?[dioxXucsfeEgGp]"); @@ -62,9 +62,9 @@ QStringList *ArgExtractor::regExpList() return _argList; } -void ArgExtractor::setArgExpressions( QStringList* list ) +void ArgExtractor::setArgExpressions( TQStringList* list ) { - sdAL.setObject( _argList, new QStringList ); - for( QStringList::Iterator it = list->begin() ; it != list->end() ; ++it ) + sdAL.setObject( _argList, new TQStringList ); + for( TQStringList::Iterator it = list->begin() ; it != list->end() ; ++it ) _argList->append(*it); } diff --git a/kbabel/common/argextractor.h b/kbabel/common/argextractor.h index 31b28c8a..dd84f1c2 100644 --- a/kbabel/common/argextractor.h +++ b/kbabel/common/argextractor.h @@ -35,11 +35,11 @@ #ifndef _ARG_EXTRACTOR_H_ #define _ARG_EXTRACTOR_H_ -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qregexp.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqregexp.h> #include "regexpextractor.h" @@ -58,23 +58,23 @@ public: /** * Create an argument extractor for "string" */ - ArgExtractor(QString string=QString::null); + ArgExtractor(TQString string=TQString::null); /** * Set a new list of tag regular expressions. It also * deletes the old tags. * @param list a list of regular expressions */ - static void setArgExpressions(QStringList* list); + static void setArgExpressions(TQStringList* list); protected: /** * @return the static list of args */ - virtual QStringList *regExpList(); + virtual TQStringList *regExpList(); private: - static QStringList *_argList; + static TQStringList *_argList; }; } 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(); diff --git a/kbabel/common/catalog.h b/kbabel/common/catalog.h index db47c48b..27b22bab 100644 --- a/kbabel/common/catalog.h +++ b/kbabel/common/catalog.h @@ -42,8 +42,8 @@ #include "catalogfileplugin.h" #include "kbproject.h" -#include <qptrlist.h> -#include <qvaluevector.h> +#include <tqptrlist.h> +#include <tqvaluevector.h> #include <kdemacros.h> #include <kstandarddirs.h> @@ -95,8 +95,8 @@ struct DocPosition */ struct DiffEntry { - QString msgid; - QString msgstr; + TQString msgid; + TQString msgstr; }; /** @@ -121,17 +121,17 @@ public: * * @return Codec for found charset or 0, if no information has been found */ - static QTextCodec* codecForFile(QString gettextHeader); + static TQTextCodec* codecForFile(TQString gettextHeader); static PoInfo headerInfo(const CatalogItem headerItem); /** * A constructor for an empty message catalog. - * @param parent parent @ref QObject for this catalog + * @param parent parent @ref TQObject for this catalog * @param name unique name for this object * @param configFile configuration file to read config from */ - Catalog(QObject* parent=0, const char* name=0, QString projectFile = QString() ); + Catalog(TQObject* parent=0, const char* name=0, TQString projectFile = TQString() ); /** * Deprecated. A copy constructor. Do not use since each Catalog registers @@ -146,7 +146,7 @@ public: * @param index index of the requested message * @return context for the given message */ - QString msgctxt(uint index) const; + TQString msgctxt(uint index) const; /** * Get list of texts for a given message in original language. Each entry in the list @@ -157,7 +157,7 @@ public: * (useful for searching etc) * @return list of singular/plural forms of the original text */ - QStringList msgid(uint index, const bool noNewlines=false) const; + TQStringList msgid(uint index, const bool noNewlines=false) const; /** * Get list of translated texts for a given message. Each entry in the list @@ -168,7 +168,7 @@ public: * (useful for searching etc) * @return list of translated singular/plural forms */ - QStringList msgstr(uint index, const bool noNewlines=false) const; + TQStringList msgstr(uint index, const bool noNewlines=false) const; /** * Get the comment for a given message. @@ -176,7 +176,7 @@ public: * @param index index of the requested message * @return comment for the given message */ - QString comment(uint index) const; + TQString comment(uint index) const; /** * Get the context information for a given message. This works @@ -187,7 +187,7 @@ public: * @return context information found in the message comment * @deprecated */ - QString context(uint index) const KDE_DEPRECATED; + TQString context(uint index) const KDE_DEPRECATED; /** * Get the header for the current file. @@ -201,31 +201,31 @@ public: * * @return string representation of the name and e-mail address */ - QString lastTranslator() const; + TQString lastTranslator() const; /** * @return The list of obsolete entries. These cannot be changed at * all and are stored for import/export purposes. */ - QValueList<CatalogItem> obsoleteEntries() const; + TQValueList<CatalogItem> obsoleteEntries() const; /** * @return The index of the item, that has the msgid id. * If no item is found, -1 is returned. */ - int indexForMsgid(const QString& id) const; + int indexForMsgid(const TQString& id) const; /** @return a list of tags in entry #index */ - QStringList tagList(uint index); + TQStringList tagList(uint index); /** @return a list of arguments in entry #index */ - QStringList argList(uint index); + TQStringList argList(uint index); /** * @return the list of errors found for a given item index * @param index index of the item to check */ - QStringList itemStatus(uint index); + TQStringList itemStatus(uint index); /** * @return the list of errors found for a given item index @@ -233,18 +233,18 @@ public: * @param recheck flag, if the item status should be checked now * @param whatToCheck what checks to do (a list of tools to be used */ - QStringList itemStatus(uint index, bool recheck, QPtrList<KDataTool> whatToCheck); + TQStringList itemStatus(uint index, bool recheck, TQPtrList<KDataTool> whatToCheck); /** * replaces msgstr in catalog item at index index with msgstr * returns true, if untranslated status changed */ - //bool setMsgstr(uint index,QString msgstr); + //bool setMsgstr(uint index,TQString msgstr); /** * replaces comment in catalog item at index index with comment * returns true, if fuzzy status changed */ - //bool setComment(uint index,QString comment); + //bool setComment(uint index,TQString comment); /** * replaces header with given String * @return false if the header is not valid @@ -270,40 +270,40 @@ public: /** * @return package name for the current catalog */ - QString packageName() const; + TQString packageName() const; /** * @return directory for the package of the current catalog */ - QString packageDir() const; + TQString packageDir() const; /** * @return package name and directory for the current catalog */ - QString package() const; + TQString package() const; /** * Setup the package for the catalog. It tries to parse the * package and split it to name and directory * @param package the name and directory to be set as package */ - void setPackage(const QString& package); + void setPackage(const TQString& package); /** * @return encoding for the current catalog */ - QString encoding() const; + TQString encoding() const; /** * opens file url by using KDE's network downlad and calls * openFile with a local filename */ - ConversionStatus openURL(const KURL& url, const QString& package=QString::null); + ConversionStatus openURL(const KURL& url, const TQString& package=TQString::null); /** * opens file openURL by using KDE's network downlad and calls * openFile with a local filename * sets current URL to saveURL */ - ConversionStatus openURL(const KURL& openURL, const KURL& saveURL, const QString& package=QString::null); + ConversionStatus openURL(const KURL& openURL, const KURL& saveURL, const TQString& package=TQString::null); /** save the file under the old filename */ ConversionStatus saveFile(); @@ -314,25 +314,25 @@ public: * saves the current catalog in a temporary file and * returns the name and path of the file. */ - QString saveTempFile(); + TQString saveTempFile(); /** * @return extra data for the catalog as set by the import filter */ - QStringList catalogExtraData() const; + TQStringList catalogExtraData() const; /** * @return ID string of the used import filter */ - QString importPluginID() const; + TQString importPluginID() const; /** * @return list of MIME types (separated by comma) this catalog * can be viewed as. It is set by the used import filter. */ - QString mimeTypes() const; + TQString mimeTypes() const; /** * @return the file codec used for the current catalog */ - QTextCodec* fileCodec() const; + TQTextCodec* fileCodec() const; /** * Check syntax of the GNU gettext PO file using 'msgfmt'. @@ -341,7 +341,7 @@ public: * @param clearError should the errors be cleared before running msgfmt * @return the file codec used for the current catalog */ - Msgfmt::Status checkSyntax(QString& output, bool clearErrors=true); + Msgfmt::Status checkSyntax(TQString& output, bool clearErrors=true); /** * checks using an external tool. The tool must provide the "validate" command @@ -355,7 +355,7 @@ public: * with the datatype expected to be CatalogItem *. The MIME type * is application/x-kbabel-catalogitem. */ - void modifyUsingTool(KDataTool* tool, const QString& command); + void modifyUsingTool(KDataTool* tool, const TQString& command); /** * Returns true, if there is an ongoing activity, such as load/save @@ -483,7 +483,7 @@ public: * the search in po-files. This way, I can easily find the first * catalog entry in the textstream */ -// static ConversionStatus readHeader(QTextStream& stream,CatalogItem& header); +// static ConversionStatus readHeader(TQTextStream& stream,CatalogItem& header); void registerView(CatalogView* view); @@ -531,23 +531,23 @@ public: * tries to find a corresponding entry for entry entry * from the list of old messages and calculates the diff for it */ - DiffResult diff(uint entry, QString* result); + DiffResult diff(uint entry, TQString* result); /** * sets a list of entries to generate a diff from */ - void setDiffList( const QValueList<DiffEntry>& ); + void setDiffList( const TQValueList<DiffEntry>& ); /** * @return the contents of this catalog as list for diffs */ - QValueList<DiffEntry> asDiffList(); + TQValueList<DiffEntry> asDiffList(); /** * @return how many plural forms are used in language lang. * If nothing is found -1 is returned. */ - static int getNumberOfPluralForms(const QString& lang); + static int getNumberOfPluralForms(const TQString& lang); public slots: /** @@ -611,7 +611,7 @@ private: void processCommand(EditCommand* cmd, CatalogView* view2exclude=0, bool undo=false); /** do the actual file write using plugin */ - ConversionStatus writeFile(QString localfile, bool overwrite=false); + ConversionStatus writeFile(TQString localfile, bool overwrite=false); /** * generates lists that contain indexes of all fuzzy and untranslated entries @@ -622,15 +622,15 @@ private: * returns value in list that is lower than parameter index * or -1 if there is none */ - int findPrevInList(const QValueList<uint>& list,uint index) const; + int findPrevInList(const TQValueList<uint>& list,uint index) const; /** * returns value in list that is bigger than parameter index * or -1 if there is none */ - int findNextInList(const QValueList<uint>& list,uint index) const; + int findNextInList(const TQValueList<uint>& list,uint index) const; /** returns the current date and time in the format of the users choice */ - QString dateTime() const; + TQString dateTime() const; /** clear the list of all errors */ void clearErrorList(); @@ -648,26 +648,26 @@ private: /** set the flag that the catalog is generated from docbook */ void setGeneratedFromDocbook(const bool generated); /** set the entries of the catalog */ - void setEntries( QValueVector<CatalogItem> entries); + void setEntries( TQValueVector<CatalogItem> entries); /** set the obsolete entries of the catalog */ - void setObsoleteEntries( QValueList<CatalogItem> entries); + void setObsoleteEntries( TQValueList<CatalogItem> entries); /** set extra data for the catalog as defined by import plugin */ - void setCatalogExtraData(const QStringList& data); + void setCatalogExtraData(const TQStringList& data); /** set file codec for the catalog */ - void setFileCodec(QTextCodec* codec); + void setFileCodec(TQTextCodec* codec); /** set the list of import errors */ - void setErrorIndex(const QValueList<uint>&errors); + void setErrorIndex(const TQValueList<uint>&errors); /** set ID of the used import plugin */ - void setImportPluginID(const QString& id); + void setImportPluginID(const TQString& id); /** set the MIME types for the current catalog as defined by import plugin */ - void setMimeTypes(const QString& mimeTypes); + void setMimeTypes(const TQString& mimeTypes); private: CatalogPrivate* d; signals: - void signalError(QString); - void signalResetProgressBar(QString,int); + void signalError(TQString); + void signalResetProgressBar(TQString,int); void signalProgress(int); void signalClearProgressBar(); diff --git a/kbabel/common/catalog_private.h b/kbabel/common/catalog_private.h index 645353f3..153c8486 100644 --- a/kbabel/common/catalog_private.h +++ b/kbabel/common/catalog_private.h @@ -35,12 +35,12 @@ #ifndef CATALOGPRIVATE_H #define CATALOGPRIVATE_H -#include <qintcache.h> -#include <qobject.h> -#include <qptrlist.h> -#include <qstringlist.h> -#include <qmap.h> -#include <qvaluevector.h> +#include <tqintcache.h> +#include <tqobject.h> +#include <tqptrlist.h> +#include <tqstringlist.h> +#include <tqmap.h> +#include <tqvaluevector.h> #include <kurl.h> #include "msgfmt.h" @@ -66,20 +66,20 @@ public: /** url of the po-file, that belongs to this catalog */ KURL _url; - QString _packageName; - QString _packageDir; + TQString _packageName; + TQString _packageDir; /** holds the entries in the catalog */ - QValueVector<CatalogItem> _entries; + TQValueVector<CatalogItem> _entries; /** The header of the po-file. */ CatalogItem _header; /** list of obsolete entries */ - QValueList<CatalogItem> _obsoleteEntries; + TQValueList<CatalogItem> _obsoleteEntries; /** identification string for used import filter*/ - QString _importID; - QString _mimeTypes; + TQString _importID; + TQString _mimeTypes; bool _modified; bool _readOnly; @@ -87,34 +87,34 @@ public: bool _active; bool _stop; - QValueList<uint> _fuzzyIndex; - QValueList<uint> _untransIndex; - QValueList<uint> _errorIndex; + TQValueList<uint> _fuzzyIndex; + TQValueList<uint> _untransIndex; + TQValueList<uint> _errorIndex; - QPtrList<CatalogView> _views; + TQPtrList<CatalogView> _views; TagSettings _tagSettings; - QPtrList<EditCommand> _undoList; - QPtrList<EditCommand> _redoList; + TQPtrList<EditCommand> _undoList; + TQPtrList<EditCommand> _redoList; - QTextCodec *fileCodec; + TQTextCodec *fileCodec; - QStringList msgidDiffList; - QMap< QString, QStringList > msgstr2MsgidDiffList; - QIntCache<QString> diffCache; + TQStringList msgidDiffList; + TQMap< TQString, TQStringList > msgstr2MsgidDiffList; + TQIntCache<TQString> diffCache; int numberOfPluralForms; Project::Ptr _project; RegExpExtractor *_tagExtractor, *_argExtractor; - QStringList _catalogExtra; + TQStringList _catalogExtra; CatalogPrivate(Project::Ptr project) : - _packageName( QString::null ), _packageDir( QString::null ), + _packageName( TQString::null ), _packageDir( TQString::null ), _header (project), - _importID( QString::null ), _mimeTypes( "text/plain" ), + _importID( TQString::null ), _mimeTypes( "text/plain" ), _modified(false), _readOnly(false), _generatedFromDocbook(false), _active(false), _stop(false), fileCodec(0), diffCache(30,76), numberOfPluralForms(-1), @@ -129,8 +129,8 @@ public: _undoList.setAutoDelete(true); _redoList.setAutoDelete(true); - _tagExtractor = new RegExpExtractor(QStringList()); - _argExtractor = new RegExpExtractor(QStringList()); + _tagExtractor = new RegExpExtractor(TQStringList()); + _argExtractor = new RegExpExtractor(TQStringList()); _catalogExtra.clear(); } diff --git a/kbabel/common/catalogfileplugin.h b/kbabel/common/catalogfileplugin.h index f47e0d89..caa94c17 100644 --- a/kbabel/common/catalogfileplugin.h +++ b/kbabel/common/catalogfileplugin.h @@ -32,7 +32,7 @@ #ifndef IMPORTPLUGIN_H #define IMPORTPLUGIN_H -#include <qobject.h> +#include <tqobject.h> #include <kdemacros.h> @@ -84,7 +84,7 @@ class KDE_EXPORT CatalogImportPlugin: public QObject Q_OBJECT public: - CatalogImportPlugin(QObject* parent, const char* name); + CatalogImportPlugin(TQObject* parent, const char* name); virtual ~CatalogImportPlugin(); /** @@ -96,7 +96,7 @@ public: * @param catalog the catalog to be filled * @return result of the operation */ - ConversionStatus open(const QString& file, const QString& mimetype, Catalog* catalog); + ConversionStatus open(const TQString& file, const TQString& mimetype, Catalog* catalog); /** * Reimplement this method to load the local file passed as an argument. @@ -108,16 +108,16 @@ public: * @param file file to be loaded * @param mimetype the expected MIME type (the type used for plugin selection */ - virtual ConversionStatus load(const QString& file, const QString& mimetype) = 0; + virtual ConversionStatus load(const TQString& file, const TQString& mimetype) = 0; /** * Reimplement this method to return unique identification of your plugin */ - virtual const QString id() = 0; + virtual const TQString id() = 0; /** @return the list of all available MIME types for which there * is a import plugin. */ - static QStringList availableImportMimeTypes(); + static TQStringList availableImportMimeTypes(); public slots: /** stop the current operation */ @@ -133,17 +133,17 @@ protected: /** set flag that the file is generated from DocBook */ void setGeneratedFromDocbook(const bool fromDocbook); /** set the list of parse error indexes */ - void setErrorIndex(const QValueList<uint>& errors); + void setErrorIndex(const TQValueList<uint>& errors); /** set the file codec */ - void setFileCodec(QTextCodec* codec); + void setFileCodec(TQTextCodec* codec); /** set extra data for the catalog, which can't be stored in * @ref CatalogItem. The format can be arbitrary */ - void setCatalogExtraData( const QStringList& data ); + void setCatalogExtraData( const TQStringList& data ); /** set the header catalog item */ void setHeader( const CatalogItem& header ); /** set the MIME types which can be used for this catalog */ - void setMimeTypes( const QString& catalog ); + void setMimeTypes( const TQString& catalog ); /** start a new transaction. You should never call this method. */ void startTransaction(); @@ -155,7 +155,7 @@ protected: signals: /** Signal start of the operation */ - void signalResetProgressBar(QString,int); + void signalResetProgressBar(TQString,int); /** Signal progress of the operation */ void signalProgress(int); /** Signal end of the operation */ @@ -179,11 +179,11 @@ class KDE_EXPORT CatalogExportPlugin: public QObject Q_OBJECT public: - CatalogExportPlugin(QObject* parent, const char* name); + CatalogExportPlugin(TQObject* parent, const char* name); virtual ~CatalogExportPlugin(); - virtual ConversionStatus save(const QString& file, const QString& mimetype, const Catalog* catalog) = 0; + virtual ConversionStatus save(const TQString& file, const TQString& mimetype, const Catalog* catalog) = 0; - static QStringList availableExportMimeTypes(); + static TQStringList availableExportMimeTypes(); public slots: void stop(); @@ -192,7 +192,7 @@ protected: bool isStopped() const; signals: - void signalResetProgressBar(QString,int); + void signalResetProgressBar(TQString,int); void signalProgress(int); void signalClearProgressBar(); diff --git a/kbabel/common/catalogitem.cpp b/kbabel/common/catalogitem.cpp index ced02e8c..bd55d7b6 100644 --- a/kbabel/common/catalogitem.cpp +++ b/kbabel/common/catalogitem.cpp @@ -40,9 +40,9 @@ #include "regexpextractor.h" -#include <qtextstream.h> -#include <qtextcodec.h> -#include <qdom.h> +#include <tqtextstream.h> +#include <tqtextcodec.h> +#include <tqdom.h> using namespace KBabel; @@ -65,16 +65,16 @@ CatalogItem::~CatalogItem() delete d; } -QString CatalogItem::comment() const +TQString CatalogItem::comment() const { return d->_comment; } -QString CatalogItem::msgctxt(const bool noNewlines) const +TQString CatalogItem::msgctxt(const bool noNewlines) const { if( noNewlines ) { - QString tmp = d->_msgctxt; + TQString tmp = d->_msgctxt; tmp.replace("\n", " "); // ### TODO: " " or "" ? return tmp; } @@ -82,9 +82,9 @@ QString CatalogItem::msgctxt(const bool noNewlines) const return d->_msgctxt; } -QStringList CatalogItem::msgid(const bool noNewlines) const +TQStringList CatalogItem::msgid(const bool noNewlines) const { - QStringList result=d->_msgid; + TQStringList result=d->_msgid; if( noNewlines ) { result.gres( "\n", "" ); @@ -92,9 +92,9 @@ QStringList CatalogItem::msgid(const bool noNewlines) const return result; } -QStringList CatalogItem::msgstr(const bool noNewlines) const +TQStringList CatalogItem::msgstr(const bool noNewlines) const { - QStringList result=d->_msgstr; + TQStringList result=d->_msgstr; if( noNewlines ) { result.gres( "\n", "" ); @@ -102,12 +102,12 @@ QStringList CatalogItem::msgstr(const bool noNewlines) const return result; } -QStringList CatalogItem::msgstrAsList(int nr) const +TQStringList CatalogItem::msgstrAsList(int nr) const { - QString str; + TQString str; if(d->_gettextPluralForm && nr > 0) { - QStringList::ConstIterator it = d->_msgstr.at(nr); + TQStringList::ConstIterator it = d->_msgstr.at(nr); if(it != d->_msgstr.end()) { str = *it; @@ -123,7 +123,7 @@ QStringList CatalogItem::msgstrAsList(int nr) const str = d->_msgstr.first(); } - QStringList list=QStringList::split("\n",str); + TQStringList list=TQStringList::split("\n",str); if(str.left(1)=="\n") list.prepend(""); @@ -139,32 +139,32 @@ bool CatalogItem::isValid() const return d->_valid; } -void CatalogItem::setMsgctxt(QString msg) +void CatalogItem::setMsgctxt(TQString msg) { d->_msgctxt=msg; } -void CatalogItem::setMsgid(QString msg) +void CatalogItem::setMsgid(TQString msg) { d->_msgid=msg; } -void CatalogItem::setMsgid(QStringList msg) +void CatalogItem::setMsgid(TQStringList msg) { d->_msgid=msg; } -void CatalogItem::setMsgstr(QString msg) +void CatalogItem::setMsgstr(TQString msg) { d->_msgstr=msg; } -void CatalogItem::setMsgstr(QStringList msg) +void CatalogItem::setMsgstr(TQStringList msg) { d->_msgstr=msg; } -void CatalogItem::setComment(QString com) +void CatalogItem::setComment(TQString com) { d->_comment=com; } @@ -174,31 +174,31 @@ void CatalogItem::setGettextPluralForm( bool _gettextPlural ) d->_gettextPluralForm = _gettextPlural; } -QStringList CatalogItem::errors() const +TQStringList CatalogItem::errors() const { return d->_errors; } -QStringList CatalogItem::tagList( RegExpExtractor& te) +TQStringList CatalogItem::tagList( RegExpExtractor& te) { if(!d->_haveTagList) { // FIXME: should care about plural forms in msgid te.setString(msgid(true).first()); - d->_tagList = QStringList(te.matches()); + d->_tagList = TQStringList(te.matches()); d->_haveTagList = true; } return d->_tagList; } -QStringList CatalogItem::argList( RegExpExtractor& te) +TQStringList CatalogItem::argList( RegExpExtractor& te) { if(!d->_haveArgList) { // FIXME: should care about plural forms in msgid te.setString(msgid(true).first()); - d->_argList = QStringList(te.matches()); + d->_argList = TQStringList(te.matches()); } return d->_argList; @@ -207,29 +207,29 @@ QStringList CatalogItem::argList( RegExpExtractor& te) bool CatalogItem::isFuzzy() const { - return d->_comment.find( QRegExp(",\\s*fuzzy") ) != -1; + return d->_comment.find( TQRegExp(",\\s*fuzzy") ) != -1; } bool CatalogItem::isCformat() const { // Allow "possible-c-format" (from xgettext --debug) or "c-format" // Note the regexp (?: ) is similar to () but it does not capture (so it is faster) - return d->_comment.find( QRegExp(",\\s*(?:possible-)c-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*(?:possible-)c-format") ) == -1; } bool CatalogItem::isNoCformat() const { - return d->_comment.find( QRegExp(",\\s*no-c-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*no-c-format") ) == -1; } bool CatalogItem::isQtformat() const { - return d->_comment.find( QRegExp(",\\s*qt-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*qt-format") ) == -1; } bool CatalogItem::isNoQtformat() const { - return d->_comment.find( QRegExp(",\\s*no-qt-format") ) == -1; + return d->_comment.find( TQRegExp(",\\s*no-qt-format") ) == -1; } bool CatalogItem::isUntranslated() const @@ -260,7 +260,7 @@ int CatalogItem::totalLines() const msgctxtLines=d->_msgctxt.contains('\n')+1; } int msgidLines=0; - QStringList::ConstIterator it; + TQStringList::ConstIterator it; for(it=d->_msgid.begin(); it != d->_msgid.end(); ++it) { msgidLines += (*it).contains('\n')+1; @@ -292,17 +292,17 @@ void CatalogItem::setSyntaxError(bool on) d->_errors.remove("syntax error"); } -QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) +TQPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) { - QPtrList<EditCommand> editList; + TQPtrList<EditCommand> editList; editList.setAutoDelete(false); - QString comment=d->_comment; + TQString comment=d->_comment; if(isFuzzy()) { EditCommand *cmd; - QRegExp fuzzyStr(",\\s*fuzzy"); + TQRegExp fuzzyStr(",\\s*fuzzy"); int offset; offset=comment.find(fuzzyStr); @@ -318,7 +318,7 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) } // remove empty comment lines - if( comment.contains( QRegExp("^#\\s*$") )) + if( comment.contains( TQRegExp("^#\\s*$") )) { cmd = new DelTextCmd(0,comment,0); cmd->setPart(Comment); @@ -326,9 +326,9 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) comment=""; } - if( comment.contains( QRegExp("\n#\\s*$") )) + if( comment.contains( TQRegExp("\n#\\s*$") )) { - offset=comment.find( QRegExp("\n#\\s*$") ); + offset=comment.find( TQRegExp("\n#\\s*$") ); while(offset>=0) { cmd = new DelTextCmd(offset,comment.mid(offset),0); @@ -337,12 +337,12 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) comment.remove(offset,comment.length()-offset); - offset=comment.find( QRegExp("\n#\\s*$"), offset+1 ); + offset=comment.find( TQRegExp("\n#\\s*$"), offset+1 ); } } - if( comment.contains( QRegExp("\n#\\s*\n") )) + if( comment.contains( TQRegExp("\n#\\s*\n") )) { - offset=comment.find( QRegExp("\n#\\s*\n") )+1; + offset=comment.find( TQRegExp("\n#\\s*\n") )+1; while(offset>=0) { int endIndex=comment.find("\n",offset)+1; @@ -353,7 +353,7 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) comment.remove(offset,endIndex-offset); - offset=comment.find( QRegExp("\n#\\s*\n"), offset+1 ); + offset=comment.find( TQRegExp("\n#\\s*\n"), offset+1 ); } } @@ -367,9 +367,9 @@ QPtrList<EditCommand> CatalogItem::removeFuzzy(bool doIt) -QPtrList<EditCommand> CatalogItem::addFuzzy(bool doIt) +TQPtrList<EditCommand> CatalogItem::addFuzzy(bool doIt) { - QPtrList<EditCommand> editList; + TQPtrList<EditCommand> editList; editList.setAutoDelete(false); @@ -378,7 +378,7 @@ QPtrList<EditCommand> CatalogItem::addFuzzy(bool doIt) EditCommand *cmd; int offset=d->_comment.length(); - QString addStr; + TQString addStr; if(offset > 0 && d->_comment[offset-1] != '\n') { addStr='\n'; @@ -487,7 +487,7 @@ void CatalogItem::operator=(const CatalogItem& rhs) d->_gettextPluralForm = rhs.d->_gettextPluralForm; } -QString CatalogItem::nextError() const +TQString CatalogItem::nextError() const { return d->_errors.first(); } @@ -497,13 +497,13 @@ void CatalogItem::clearErrors() d->_errors.clear(); } -void CatalogItem::appendError(const QString& error ) +void CatalogItem::appendError(const TQString& error ) { if( !d->_errors.contains( error ) ) d->_errors.append(error); } -void CatalogItem::removeError(const QString& error ) +void CatalogItem::removeError(const TQString& error ) { d->_errors.remove(error); } diff --git a/kbabel/common/catalogitem.h b/kbabel/common/catalogitem.h index 91e6cc25..9a7d6071 100644 --- a/kbabel/common/catalogitem.h +++ b/kbabel/common/catalogitem.h @@ -34,8 +34,8 @@ #ifndef CATALOGITEM_H #define CATALOGITEM_H -#include <qstringlist.h> -#include <qptrlist.h> +#include <tqstringlist.h> +#include <tqptrlist.h> #include "pluralforms.h" #include "editcmd.h" @@ -127,14 +127,14 @@ public: * @param doIt if false, the comment is not changed, just the * commands for doing it are calculated */ - QPtrList<EditCommand> removeFuzzy(bool doIt=true); + TQPtrList<EditCommand> removeFuzzy(bool doIt=true); /** * adds the string ", fuzzy" to the comment * @param doIt if false, the comment is not changed, just the * commands for doing it are calculated */ - QPtrList<EditCommand> addFuzzy(bool doIt=true); + TQPtrList<EditCommand> addFuzzy(bool doIt=true); /** cleares the item */ @@ -142,13 +142,13 @@ public: /** returns the comment of this entry */ - QString comment() const; + TQString comment() const; /** returns the msgctxt of this entry */ - QString msgctxt(const bool noNewlines = false) const; + TQString msgctxt(const bool noNewlines = false) const; /** returns the msgid of the entry */ - QStringList msgid(const bool noNewlines = false) const; + TQStringList msgid(const bool noNewlines = false) const; /** returns the msgstr of the entry */ - QStringList msgstr(const bool noNewlines = false) const; + TQStringList msgstr(const bool noNewlines = false) const; /** * @param pluralNr If this item is a gettext plural form item, @@ -156,14 +156,14 @@ public: * is returned * @return the msgstr as list */ - QStringList msgstrAsList(int pluralNr=0) const; - - void setComment(QString com); - void setMsgctxt(QString msg); - void setMsgid(QString msg); - void setMsgid(QStringList msg); - void setMsgstr(QString msg); - void setMsgstr(QStringList msg); + TQStringList msgstrAsList(int pluralNr=0) const; + + void setComment(TQString com); + void setMsgctxt(TQString msg); + void setMsgid(TQString msg); + void setMsgid(TQStringList msg); + void setMsgstr(TQString msg); + void setMsgstr(TQStringList msg); void setGettextPluralForm( bool _gettextPlurals ); @@ -173,20 +173,20 @@ public: /** @return a list of tags in the msgid */ - QStringList tagList( RegExpExtractor& tagExtractor ); + TQStringList tagList( RegExpExtractor& tagExtractor ); /** @return a list of args in the msgid */ - QStringList argList( RegExpExtractor& argExtractor); + TQStringList argList( RegExpExtractor& argExtractor); /** * @return the list of all errors of this item */ - QStringList errors() const; + TQStringList errors() const; - QString nextError() const; + TQString nextError() const; void clearErrors(); - void removeError(const QString& error); - void appendError(const QString& error); + void removeError(const TQString& error); + void appendError(const TQString& error); /** * makes some sanity checks and set status accordingly @@ -200,8 +200,8 @@ public: * @param neededLines how many lines a string with singular-plural form * must have */ - int checkErrors(QChar accelMarker, const QRegExp& contextInfo - , const QRegExp& singularPlural, const int neededLines); + int checkErrors(TQChar accelMarker, const TQRegExp& contextInfo + , const TQRegExp& singularPlural, const int neededLines); void operator=(const CatalogItem& rhs); diff --git a/kbabel/common/catalogitem_private.h b/kbabel/common/catalogitem_private.h index 15c81fc7..411e76b2 100644 --- a/kbabel/common/catalogitem_private.h +++ b/kbabel/common/catalogitem_private.h @@ -34,7 +34,7 @@ #ifndef CATALOGITEMPRIVATE_H #define CATALOGITEMPRIVATE_H -#include <qstringlist.h> +#include <tqstringlist.h> namespace KBabel { @@ -55,18 +55,18 @@ class CatalogItemPrivate public: - QString _comment; - QString _msgctxt; - QStringList _msgid; - QStringList _msgstr; + TQString _comment; + TQString _msgctxt; + TQStringList _msgid; + TQStringList _msgstr; - QStringList _tagList; - QStringList _argList; + TQStringList _tagList; + TQStringList _argList; bool _valid; bool _haveTagList; bool _haveArgList; - QStringList _errors; + TQStringList _errors; /** flag, if this entry is a plural forms entry */ bool _gettextPluralForm; diff --git a/kbabel/common/catalogsettings.cpp b/kbabel/common/catalogsettings.cpp index 480f4cb9..4b87f522 100644 --- a/kbabel/common/catalogsettings.cpp +++ b/kbabel/common/catalogsettings.cpp @@ -43,19 +43,19 @@ #include <stdlib.h> -#include <qfile.h> -#include <qtextcodec.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqtextcodec.h> +#include <tqregexp.h> #include <stdlib.h> using namespace KBabel; -QString KBabel::charsetString(const QTextCodec *codec) +TQString KBabel::charsetString(const TQTextCodec *codec) { if(codec) { - QString encodingStr = codec->mimeName(); + TQString encodingStr = codec->mimeName(); if ( encodingStr.startsWith("CP " ) ) encodingStr.remove( 2, 1 ); else if ( encodingStr.startsWith("IBM " ) ) @@ -63,14 +63,14 @@ QString KBabel::charsetString(const QTextCodec *codec) return encodingStr; } else - return QString::null; + return TQString::null; } -QString KBabel::GNUPluralForms(const QString& lang) +TQString KBabel::GNUPluralForms(const TQString& lang) { KTempFile infile, outfile; - QTextStream* str = infile.textStream(); + TQTextStream* str = infile.textStream(); *str << "# SOME DESCRIPTIVE TITLE." << endl; *str << "# Copyright (C) YEAR Free Software Foundation, Inc." << endl; @@ -105,24 +105,24 @@ QString KBabel::GNUPluralForms(const QString& lang) msginit.start( KProcess::Block ); - QString res(""); + TQString res(""); if( msginit.normalExit() ) { // parse out the plural form string - QFile f(outfile.name()); + TQFile f(outfile.name()); if( f.open (IO_ReadOnly) ) { - QTextStream str(&f); + TQTextStream str(&f); - QString line; + TQString line; do { line = str.readLine(); if( line.startsWith( "\"Plural-Forms:" ) ) { kdDebug() << "Plural form line: " << line << endl; - QRegExp re( "^\"Plural-Forms: *(.*)\\\\n\"" ); + TQRegExp re( "^\"Plural-Forms: *(.*)\\\\n\"" ); re.search( line ); res = re.cap(1); break; @@ -141,15 +141,15 @@ QString KBabel::GNUPluralForms(const QString& lang) return res; } -QString KBabel::charsetString(const int e) +TQString KBabel::charsetString(const int e) { - QString encodingStr; + TQString encodingStr; switch(e) { case ProjectSettingsBase::Locale: { - QTextCodec *codec=QTextCodec::codecForLocale(); + TQTextCodec *codec=TQTextCodec::codecForLocale(); if(codec) encodingStr=charsetString(codec); else @@ -172,36 +172,36 @@ QString KBabel::charsetString(const int e) return encodingStr; } -QString Defaults::Identity::authorName() +TQString Defaults::Identity::authorName() { KEMailSettings emSet; return emSet.getSetting(KEMailSettings::RealName); } -QString Defaults::Identity::authorLocalizedName() +TQString Defaults::Identity::authorLocalizedName() { return authorName(); } -QString Defaults::Identity::authorEmail() +TQString Defaults::Identity::authorEmail() { KEMailSettings emSet; return emSet.getSetting(KEMailSettings::EmailAddress); } -QString Defaults::Identity::mailingList() +TQString Defaults::Identity::mailingList() { - QString lang=Defaults::Identity::languageCode(); + TQString lang=Defaults::Identity::languageCode(); int temp=lang.find("_"); lang=lang.left(temp); return lang+"@li.org"; } -QString Defaults::Identity::languageCode() +TQString Defaults::Identity::languageCode() { // first try to get the language from KDE settings KLocale *locale = KGlobal::locale(); - QString lang; + TQString lang; if(locale) { lang=locale->languageList().first(); @@ -223,18 +223,18 @@ QString Defaults::Identity::languageCode() return lang; } -QString Defaults::Identity::timezone() +TQString Defaults::Identity::timezone() { - QString timezone=getenv("TIMEZONE"); + TQString timezone=getenv("TIMEZONE"); if(timezone.isEmpty()) timezone="GMT"; return timezone; } -QStringList Defaults::Tag::tagExpressions() +TQStringList Defaults::Tag::tagExpressions() { - QStringList list; + TQStringList list; list.append("</[A-Za-z0-9\\n]+>"); list.append("<[A-Za-z0-9\\n]+[^>]*/?>"); @@ -246,9 +246,9 @@ QStringList Defaults::Tag::tagExpressions() return list; } -QStringList Defaults::Tag::argExpressions() +TQStringList Defaults::Tag::argExpressions() { - QStringList list; + TQStringList list; list.append("%[ndioxXucsfeEgGp]"); list.append("%([0-9]+(\\$))?[-+'#0]?[0-9]*(.[0-9]+)?[hlL]?[dioxXucsfeEgGp]"); diff --git a/kbabel/common/catalogsettings.h b/kbabel/common/catalogsettings.h index f87ec673..5d220e57 100644 --- a/kbabel/common/catalogsettings.h +++ b/kbabel/common/catalogsettings.h @@ -34,9 +34,9 @@ #ifndef CATALOGSETTINGS_H #define CATALOGSETTINGS_H -#include <qstring.h> -#include <qregexp.h> -#include <qdatetime.h> +#include <tqstring.h> +#include <tqregexp.h> +#include <tqdatetime.h> #include <kdemacros.h> class QTextCodec; @@ -56,7 +56,7 @@ struct KDE_EXPORT SaveSettings bool updateProject; bool updateDescription; - QString descriptionString; + TQString descriptionString; bool updateTranslatorCopyright; int FSFCopyright; @@ -64,9 +64,9 @@ struct KDE_EXPORT SaveSettings bool useOldEncoding; Qt::DateFormat dateFormat; - QString customDateFormat; + TQString customDateFormat; - QString projectString; + TQString projectString; bool autoSyntaxCheck; bool saveObsolete; @@ -76,13 +76,13 @@ struct KDE_EXPORT SaveSettings struct KDE_EXPORT IdentitySettings { - QString authorName; - QString authorLocalizedName; - QString authorEmail; - QString languageName; - QString languageCode; - QString mailingList; - QString timeZone; + TQString authorName; + TQString authorLocalizedName; + TQString authorEmail; + TQString languageName; + TQString languageCode; + TQString mailingList; + TQString timeZone; /** * The number of plural forms. If <= 0 the number is determined @@ -94,7 +94,7 @@ struct KDE_EXPORT IdentitySettings */ bool checkPluralArgument; - QString gnuPluralFormHeader; + TQString gnuPluralFormHeader; }; @@ -104,19 +104,19 @@ struct KDE_EXPORT MiscSettings * The char, that marks keyboard accelerators. * Default is '&' as used by Qt */ - QChar accelMarker; + TQChar accelMarker; /** * The regular expression for what is context information. * Default is "^_:.+" as used in KDE */ - QRegExp contextInfo; + TQRegExp contextInfo; /** * The regular expression for strings that contain a message for * singular and one for plural */ - QRegExp singularPlural; + TQRegExp singularPlural; /** * The method used for compresion of email attachments. Use @@ -137,35 +137,35 @@ struct TagSettings /** * A list of regular expressions defining tags */ - QStringList tagExpressions; + TQStringList tagExpressions; /** * A list of regular expressions defining arguments */ - QStringList argExpressions; + TQStringList argExpressions; }; -KDE_EXPORT QString charsetString(const int encoding); -KDE_EXPORT QString charsetString(const QTextCodec *codec); -KDE_EXPORT QString GNUPluralForms(const QString& lang); +KDE_EXPORT TQString charsetString(const int encoding); +KDE_EXPORT TQString charsetString(const TQTextCodec *codec); +KDE_EXPORT TQString GNUPluralForms(const TQString& lang); namespace Defaults { class KDE_EXPORT Identity { public: - static QString authorName(); - static QString authorLocalizedName(); - static QString authorEmail(); - static QString languageCode(); - static QString mailingList(); - static QString timezone(); + static TQString authorName(); + static TQString authorLocalizedName(); + static TQString authorEmail(); + static TQString languageCode(); + static TQString mailingList(); + static TQString timezone(); }; class KDE_EXPORT Tag { public: - static QStringList tagExpressions(); - static QStringList argExpressions(); + static TQStringList tagExpressions(); + static TQStringList argExpressions(); }; } diff --git a/kbabel/common/diff.cpp b/kbabel/common/diff.cpp index 7a54e4d3..455a26f1 100644 --- a/kbabel/common/diff.cpp +++ b/kbabel/common/diff.cpp @@ -37,7 +37,7 @@ #include <kdebug.h> -LCSprinter::LCSprinter(const QStringList &s_1, const QStringList &s_2, QValueVector<LCSMarker> *b_, const uint nT_, uint index):s1(s_1),s2(s_2),b(b_),nT(nT_) +LCSprinter::LCSprinter(const TQStringList &s_1, const TQStringList &s_2, TQValueVector<LCSMarker> *b_, const uint nT_, uint index):s1(s_1),s2(s_2),b(b_),nT(nT_) { it1=s1.begin(); it2=s2.begin(); @@ -93,24 +93,24 @@ void LCSprinter::printLCS(uint index) -QString wordDiff(const QString& str1, const QString& str2) +TQString wordDiff(const TQString& str1, const TQString& str2) { //separate punctuation marks etc from words as _only_ they may have changed - QStringList s1, s2; + TQStringList s1, s2; uint i=0; uint j=0; uint l1=str1.length(); uint l2=str2.length(); - QString temp; + TQString temp; temp.reserve(16); /* while ( i<l1 ) { - if (str1[i]==QChar(0x003C) && (str1[i+1]==QChar(0x002F) || str1[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" + if (str1[i]==TQChar(0x003C) && (str1[i+1]==TQChar(0x002F) || str1[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" {// skip tag - while(i<l1 && str1[i]!=QChar(0x003E)) temp += str1[i++]; - if (i++ <l1) temp += QChar(0x003E); + while(i<l1 && str1[i]!=TQChar(0x003E)) temp += str1[i++]; + if (i++ <l1) temp += TQChar(0x003E); s1.append(temp); temp.truncate(0); } @@ -125,15 +125,15 @@ QString wordDiff(const QString& str1, const QString& str2) temp.truncate(0); }; - if (str1[i]==QChar(0x003C) && (str1[i+1]==QChar(0x002F) || str1[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" + if (str1[i]==TQChar(0x003C) && (str1[i+1]==TQChar(0x002F) || str1[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" {// skip tag - while(i<l1 && str1[i]!=QChar(0x003E)) temp += str1[i++]; - if (i++ <l1) temp += QChar(0x003E); + while(i<l1 && str1[i]!=TQChar(0x003E)) temp += str1[i++]; + if (i++ <l1) temp += TQChar(0x003E); s1.append(temp); temp.truncate(0); } - while ( i<l1 && !(str1[i].isLetter() || str1[i]==QChar(0x003C)) ) + while ( i<l1 && !(str1[i].isLetter() || str1[i]==TQChar(0x003C)) ) { temp += str1[i++]; } @@ -147,10 +147,10 @@ QString wordDiff(const QString& str1, const QString& str2) i=0; while ( i<l2 ) { - if (str2[i]==QChar(0x003C) && (str2[i+1]==QChar(0x002F) || str2[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" + if (str2[i]==TQChar(0x003C) && (str2[i+1]==TQChar(0x002F) || str2[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" {// skip tag - while(i<l2 && str2[i]!=QChar(0x003E)) temp += str2[i++]; - if (i++ <l2) temp += QChar(0x003E); + while(i<l2 && str2[i]!=TQChar(0x003E)) temp += str2[i++]; + if (i++ <l2) temp += TQChar(0x003E); s2.append(temp); temp.truncate(0); } @@ -165,15 +165,15 @@ QString wordDiff(const QString& str1, const QString& str2) temp.truncate(0); }; //FIXME bounds - if (str2[i]==QChar(0x003C) && (str2[i+1]==QChar(0x002F) || str2[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" + if (str2[i]==TQChar(0x003C) && (str2[i+1]==TQChar(0x002F) || str2[i+1].isLetter()) ) // 0x003C="<", 0x002F="/" {// skip tag - while(i<l2 && str2[i]!=QChar(0x003E)) temp += str2[i++]; - if (i++ <l2) temp += QChar(0x003E); + while(i<l2 && str2[i]!=TQChar(0x003E)) temp += str2[i++]; + if (i++ <l2) temp += TQChar(0x003E); s2.append(temp); temp.truncate(0); } - while ( i<l2 && !(str2[i].isLetter() || str2[i]==QChar(0x003C)) ) + while ( i<l2 && !(str2[i].isLetter() || str2[i]==TQChar(0x003C)) ) { temp += str2[i++]; } @@ -199,7 +199,7 @@ QString wordDiff(const QString& str1, const QString& str2) while ( i<l1 && !str1[i].isLetter() ) { - s1.append(QString(str1[i++])); + s1.append(TQString(str1[i++])); } } @@ -218,7 +218,7 @@ QString wordDiff(const QString& str1, const QString& str2) while ( i<l2 && !str2[i].isLetter() ) { - s2.append(QString(str2[i++])); + s2.append(TQString(str2[i++])); } } @@ -228,14 +228,14 @@ QString wordDiff(const QString& str1, const QString& str2) uint mT = mX+1; uint nT = nY+1; - QValueVector<LCSMarker> b(mT*nT, NOTHING); - QValueVector<uint> c(mT*nT, 0); + TQValueVector<LCSMarker> b(mT*nT, NOTHING); + TQValueVector<uint> c(mT*nT, 0); // calculate the LCS b[0] = FINAL; uint index_cache; - QStringList::iterator it1, it2; + TQStringList::iterator it1, it2; for (i=1, it1 = s1.begin(); i<mT; ++i, ++it1) { @@ -295,7 +295,7 @@ QString wordDiff(const QString& str1, const QString& str2) /* // old algorithm by Wolfram Diestel <[email protected]> -QString Diff::charDiff(QString s1, QString s2) +TQString Diff::charDiff(TQString s1, TQString s2) { int n = 3; s1+="xxx"; @@ -305,7 +305,7 @@ QString Diff::charDiff(QString s1, QString s2) int pos2=0; int len1 = s1.length(); int len2 = s2.length(); - QString resultstr; + TQString resultstr; bool found = true; bool swap = false; while (found && pos1+n < len1 && pos2+n < len2) @@ -346,7 +346,7 @@ QString Diff::charDiff(QString s1, QString s2) pos1 = pos2; pos2 = pos; - QString s = s1; + TQString s = s1; s1 = s2; s2 = s; @@ -375,7 +375,7 @@ QString Diff::charDiff(QString s1, QString s2) pos1 = pos2; pos2 = pos; - QString s = s1; + TQString s = s1; s1 = s2; s2 = s; @@ -427,7 +427,7 @@ QString Diff::charDiff(QString s1, QString s2) pos1 = pos2; pos2 = pos; - QString s = s1; + TQString s = s1; s1 = s2; s2 = s; diff --git a/kbabel/common/diff.h b/kbabel/common/diff.h index 4e7dfb72..2ce055bf 100644 --- a/kbabel/common/diff.h +++ b/kbabel/common/diff.h @@ -35,8 +35,8 @@ #ifndef DIFF_H #define DIFF_H -#include <qvaluevector.h> -#include <qstringlist.h> +#include <tqvaluevector.h> +#include <tqstringlist.h> typedef enum { @@ -54,7 +54,7 @@ typedef enum * @short Word-by-word diff algorithm * @author Nick Shaforostoff <[email protected]> */ - QString wordDiff(const QString& oldString, const QString& newString); + TQString wordDiff(const TQString& oldString, const TQString& newString); /** @@ -66,22 +66,22 @@ typedef enum class LCSprinter { public: - LCSprinter(const QStringList &s_1, const QStringList &s_2, QValueVector<LCSMarker>* b_, const uint nT_, uint index); + LCSprinter(const TQStringList &s_1, const TQStringList &s_2, TQValueVector<LCSMarker>* b_, const uint nT_, uint index); void printLCS(uint index); - inline QString getString(); + inline TQString getString(); ~LCSprinter() {}; private: - QStringList s1, s2, resultString; + TQStringList s1, s2, resultString; uint nT;//for use 1d vector as 2d - QValueVector<LCSMarker> *b; - QStringList::iterator it1, it2; + TQValueVector<LCSMarker> *b; + TQStringList::iterator it1, it2; }; -inline QString LCSprinter::getString() +inline TQString LCSprinter::getString() { - return resultString.join("").replace(QChar('\n'), ""); //w/o replace we'd get whole line colored + return resultString.join("").replace(TQChar('\n'), ""); //w/o replace we'd get whole line colored } #endif // DIFF_H diff --git a/kbabel/common/editcmd.cpp b/kbabel/common/editcmd.cpp index 1643ed0b..4ea98364 100644 --- a/kbabel/common/editcmd.cpp +++ b/kbabel/common/editcmd.cpp @@ -31,7 +31,7 @@ **************************************************************************** */ #include "editcmd.h" -#include <qregexp.h> +#include <tqregexp.h> using namespace KBabel; @@ -49,7 +49,7 @@ EditCommand::EditCommand(const int index, const Part part) // have to handle deletion of current selection -DelTextCmd::DelTextCmd(int _offset, const QString &_str, int _pluralNumber ) +DelTextCmd::DelTextCmd(int _offset, const TQString &_str, int _pluralNumber ) : EditCommand(), offset( _offset ), str ( _str ), @@ -68,7 +68,7 @@ bool DelTextCmd::merge( EditCommand* other) && o->type() == type() && o->pluralNumber==pluralNumber ) { DelTextCmd* o = (DelTextCmd*) other; - if ( offset + int(str.length()) == o->offset && !str.contains(QRegExp("^\\s$")) ) + if ( offset + int(str.length()) == o->offset && !str.contains(TQRegExp("^\\s$")) ) { o->str.prepend( str ); o->offset = offset; @@ -80,7 +80,7 @@ bool DelTextCmd::merge( EditCommand* other) -InsTextCmd::InsTextCmd(int offset,const QString &str, int pluralNumber ) +InsTextCmd::InsTextCmd(int offset,const TQString &str, int pluralNumber ) : DelTextCmd( offset, str, pluralNumber ) { } @@ -95,7 +95,7 @@ bool InsTextCmd::merge( EditCommand* other) if ( o->index()==index() && o->part() == part() && o->type() == type() && o->pluralNumber==pluralNumber ) { - if ( offset == o->offset + int(o->str.length()) && !str.contains(QRegExp("^\\s$")) ) + if ( offset == o->offset + int(o->str.length()) && !str.contains(TQRegExp("^\\s$")) ) { o->str += str; return true; diff --git a/kbabel/common/editcmd.h b/kbabel/common/editcmd.h index 458d2c57..64bd4b93 100644 --- a/kbabel/common/editcmd.h +++ b/kbabel/common/editcmd.h @@ -34,7 +34,7 @@ #include "itempart.h" -#include <qstring.h> +#include <tqstring.h> #include <kdemacros.h> namespace KBabel @@ -87,11 +87,11 @@ class KDE_EXPORT DelTextCmd : public EditCommand { public: int offset; - QString str; + TQString str; int pluralNumber; // have to handle deletion of current selection - DelTextCmd(int offset, const QString &str, int pluralNumber ); + DelTextCmd(int offset, const TQString &str, int pluralNumber ); virtual Commands type() const { return Delete; } bool merge( EditCommand* other); @@ -101,7 +101,7 @@ class KDE_EXPORT InsTextCmd : public DelTextCmd { public: - InsTextCmd(int offset,const QString &str, int pluralNumber ); + InsTextCmd(int offset,const TQString &str, int pluralNumber ); virtual Commands type() const { return Insert; } bool merge( EditCommand* other); diff --git a/kbabel/common/exportplugin.cpp b/kbabel/common/exportplugin.cpp index 99a727f8..327e85d0 100644 --- a/kbabel/common/exportplugin.cpp +++ b/kbabel/common/exportplugin.cpp @@ -33,7 +33,7 @@ #include "catalogfileplugin.h" -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdebug.h> #include <ktrader.h> @@ -45,7 +45,7 @@ struct KBabel::CatalogExportPluginPrivate bool _stop; }; -CatalogExportPlugin::CatalogExportPlugin(QObject* parent, const char* name) : QObject(parent,name) +CatalogExportPlugin::CatalogExportPlugin(TQObject* parent, const char* name) : TQObject(parent,name) { d = new CatalogExportPluginPrivate; d->_stop=false; @@ -56,9 +56,9 @@ CatalogExportPlugin::~CatalogExportPlugin() delete d; } -QStringList CatalogExportPlugin::availableExportMimeTypes() +TQStringList CatalogExportPlugin::availableExportMimeTypes() { - QStringList result; + TQStringList result; KTrader::OfferList offers = KTrader::self()->query("KBabelFilter", "exist [X-KDE-Export]"); diff --git a/kbabel/common/findoptions.h b/kbabel/common/findoptions.h index 45c29e25..4b5f94a9 100644 --- a/kbabel/common/findoptions.h +++ b/kbabel/common/findoptions.h @@ -35,7 +35,7 @@ #ifndef FINDOPTIONS_H #define FINDOPTIONS_H -#include <qregexp.h> +#include <tqregexp.h> class QString; class QChar; @@ -46,7 +46,7 @@ namespace KBabel class FindOptions { public: - QString findStr; + TQString findStr; bool caseSensitive; bool wholeWords; @@ -69,15 +69,15 @@ public: // these are non-persistent options - not saved into configuration database bool askFile; // whether findNext should ask catalog manager for next file - QRegExp contextInfo; // actual settings of context info regular expression - QChar accelMarker; // actual settings of accelerator marker + TQRegExp contextInfo; // actual settings of context info regular expression + TQChar accelMarker; // actual settings of accelerator marker }; class ReplaceOptions : public FindOptions { public: - QString replaceStr; + TQString replaceStr; bool ask; }; diff --git a/kbabel/common/importplugin.cpp b/kbabel/common/importplugin.cpp index d763e670..711d77cd 100644 --- a/kbabel/common/importplugin.cpp +++ b/kbabel/common/importplugin.cpp @@ -36,14 +36,14 @@ #include "catalog.h" -#include <qstringlist.h> +#include <tqstringlist.h> #include <kdebug.h> #include <ktrader.h> using namespace KBabel; -CatalogImportPlugin::CatalogImportPlugin(QObject* parent, const char* name) : QObject(parent,name) +CatalogImportPlugin::CatalogImportPlugin(TQObject* parent, const char* name) : TQObject(parent,name) { d = new CatalogImportPluginPrivate; d->_catalog = 0; @@ -64,7 +64,7 @@ void CatalogImportPlugin::appendCatalogItem( const CatalogItem& item, const bool d->_entries.append(item); } -void CatalogImportPlugin::setCatalogExtraData( const QStringList& data ) +void CatalogImportPlugin::setCatalogExtraData( const TQStringList& data ) { d->_catalogExtraData=data; d->_updateCatalogExtraData=true; @@ -76,13 +76,13 @@ void CatalogImportPlugin::setGeneratedFromDocbook( const bool generated ) d->_updateGeneratedFromDocbook = true; } -void CatalogImportPlugin::setErrorIndex(const QValueList<uint>& errors) +void CatalogImportPlugin::setErrorIndex(const TQValueList<uint>& errors) { d->_errorList = errors; d->_updateErrorList = true; } -void CatalogImportPlugin::setFileCodec(QTextCodec* codec) +void CatalogImportPlugin::setFileCodec(TQTextCodec* codec) { d->_codec=codec; d->_updateCodec = true; @@ -94,12 +94,12 @@ void CatalogImportPlugin::setHeader( const CatalogItem& item ) d->_updateHeader=true; } -void CatalogImportPlugin::setMimeTypes( const QString& mimetypes ) +void CatalogImportPlugin::setMimeTypes( const TQString& mimetypes ) { d->_mimeTypes=mimetypes; } -ConversionStatus CatalogImportPlugin::open(const QString& file, const QString& mimetype, Catalog* catalog) +ConversionStatus CatalogImportPlugin::open(const TQString& file, const TQString& mimetype, Catalog* catalog) { d->_stopped=false; d->_catalog=catalog; @@ -138,9 +138,9 @@ void CatalogImportPlugin::commitTransaction() d->_catalog->clear(); // fill in the entries - QValueVector<CatalogItem> e; + TQValueVector<CatalogItem> e; e.reserve( d->_entries.count() ); - for( QValueList<CatalogItem>::const_iterator it = d->_entries.begin(); it != d->_entries.end(); ++it ) + for( TQValueList<CatalogItem>::const_iterator it = d->_entries.begin(); it != d->_entries.end(); ++it ) { e.append( *it ); } @@ -167,9 +167,9 @@ void CatalogImportPlugin::commitTransaction() d->_started = false; } -QStringList CatalogImportPlugin::availableImportMimeTypes() +TQStringList CatalogImportPlugin::availableImportMimeTypes() { - QStringList result; + TQStringList result; KTrader::OfferList offers = KTrader::self()->query("KBabelFilter", "exist [X-KDE-Import]"); diff --git a/kbabel/common/importplugin_private.h b/kbabel/common/importplugin_private.h index 3c45919c..bff1ed90 100644 --- a/kbabel/common/importplugin_private.h +++ b/kbabel/common/importplugin_private.h @@ -48,14 +48,14 @@ public: bool _started; bool _stopped; - QValueList<CatalogItem> _entries; - QValueList<CatalogItem> _obsoleteEntries; + TQValueList<CatalogItem> _entries; + TQValueList<CatalogItem> _obsoleteEntries; CatalogItem _header; bool _generatedFromDocbook; - QTextCodec* _codec; - QValueList<uint> _errorList; - QStringList _catalogExtraData; - QString _mimeTypes; + TQTextCodec* _codec; + TQValueList<uint> _errorList; + TQStringList _catalogExtraData; + TQString _mimeTypes; bool _updateHeader; bool _updateGeneratedFromDocbook; diff --git a/kbabel/common/kbabeldatatool.h b/kbabel/common/kbabeldatatool.h index 57d9f771..207f8bc5 100644 --- a/kbabel/common/kbabeldatatool.h +++ b/kbabel/common/kbabeldatatool.h @@ -49,13 +49,13 @@ class KBabelDataTool: public KDataTool Q_OBJECT protected: - KBabelDataTool( QObject* parent, const char* name ) : KDataTool( parent, name ) {} + KBabelDataTool( TQObject* parent, const char* name ) : KDataTool( parent, name ) {} public slots: /** The only method to be redefined in inherited classes. * This method is called everytime the settings are changed. * @param project is ID of the project, for which the settings changed. */ - virtual void settingsChanged(const QString &project) = 0; + virtual void settingsChanged(const TQString &project) = 0; }; } diff --git a/kbabel/common/kbmailer.cpp b/kbabel/common/kbmailer.cpp index fb3ab3b1..0526bd74 100644 --- a/kbabel/common/kbmailer.cpp +++ b/kbabel/common/kbmailer.cpp @@ -33,11 +33,11 @@ **************************************************************************** */ -#include <qfileinfo.h> -#include <qregexp.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qwidget.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqwidget.h> #include <kapplication.h> #include <kio/netaccess.h> @@ -53,7 +53,7 @@ using namespace KBabel; -KBabelMailer::KBabelMailer( QWidget* parent, Project::Ptr project) +KBabelMailer::KBabelMailer( TQWidget* parent, Project::Ptr project) : _project( project ), m_parent( parent ) { m_tempDir.setAutoDelete( true ); @@ -65,12 +65,12 @@ KBabelMailer::~KBabelMailer() saveConfig( ); } -void KBabelMailer::sendOneFile(const QString& fileName) +void KBabelMailer::sendOneFile(const TQString& fileName) { if (!singleFileCompression) { kapp->invokeMailer("", "", "", "", "", "", fileName); } else { - const QString archive ( createArchive( QStringList( fileName ), QFileInfo( fileName ).baseName() ) ); + const TQString archive ( createArchive( TQStringList( fileName ), TQFileInfo( fileName ).baseName() ) ); if ( !archive.isEmpty() ) { kapp->invokeMailer("", "", "", "", "", "", archive); } @@ -91,13 +91,13 @@ void KBabelMailer::sendOneFile( const KURL& url) } if (!singleFileCompression) { - QString fileName( url.filename() ); + TQString fileName( url.filename() ); if ( fileName.isEmpty() ) { fileName = "attachment"; } // ### TODO: the current implementation has the default to possibly overwrite an already existing temporary file - QString tempName( m_tempDir.name() ); + TQString tempName( m_tempDir.name() ); tempName += fileName; if ( KIO::NetAccess::download( url, tempName, m_parent ) ) kapp->invokeMailer("", "", "", "", "", "", fileName); @@ -108,47 +108,47 @@ void KBabelMailer::sendOneFile( const KURL& url) } else { - const QString archive ( createArchive( QStringList( url.url() ), url.filename() ) ); + const TQString archive ( createArchive( TQStringList( url.url() ), url.filename() ) ); if ( !archive.isEmpty() ) { kapp->invokeMailer("", "", "", "", "", "", archive); } } } -void KBabelMailer::sendFiles(QStringList fileList, const QString& initialName) +void KBabelMailer::sendFiles(TQStringList fileList, const TQString& initialName) { - const QString archive ( createArchive( fileList, initialName ) ); + const TQString archive ( createArchive( fileList, initialName ) ); if ( !archive.isEmpty() ) { kapp->invokeMailer("", "", "", "", "", "", archive); } } -QString KBabelMailer::createArchive(QStringList fileList, QString initialName) +TQString KBabelMailer::createArchive(TQStringList fileList, TQString initialName) { if ( m_tempDir.name().isEmpty() ) { kdWarning() << "KBabelMailer has not a valid temporary directory!" << endl; - return QString(); // No temporary directory! + return TQString(); // No temporary directory! } // do nothing if there are no files in the list if (fileList.empty()) - return QString::null; + return TQString::null; // determine the name of the archive, do nothing if none is given // or Cancel was pressed - initialName = ( initialName.isEmpty() ? QString("translations") : initialName ); + initialName = ( initialName.isEmpty() ? TQString("translations") : initialName ); bool ok = false; - QStringList list( archiveList ); + TQStringList list( archiveList ); list.prepend( initialName ); - QString archiveName ( KInputDialog::getItem( i18n("Save"), + TQString archiveName ( KInputDialog::getItem( i18n("Save"), i18n( "Enter the name of the archive without file extension" ), archiveList, 0, true, &ok, m_parent ) ); if ( !ok || archiveName.isEmpty() ) - return QString(); + return TQString(); // file extensions are determined from the type of compression - archiveName.remove( QRegExp( "\\.tar\\.(gz|bz2)$" ) ); + archiveName.remove( TQRegExp( "\\.tar\\.(gz|bz2)$" ) ); // Update the list of archive names, keep only the ten most recent ones. archiveList.remove( archiveName ); @@ -157,7 +157,7 @@ QString KBabelMailer::createArchive(QStringList fileList, QString initialName) archiveList.pop_back(); // set the correct extension and mimetype - QString mimetype; + TQString mimetype; if (bzipCompression) { archiveName += ".tar.bz2"; mimetype = "application/x-bzip2"; @@ -169,18 +169,18 @@ QString KBabelMailer::createArchive(QStringList fileList, QString initialName) return buildArchive (fileList, m_tempDir.name()+archiveName, mimetype, true); } -QString KBabelMailer::buildArchive(QStringList fileList, QString archiveName, QString mimetype, bool remove) +TQString KBabelMailer::buildArchive(TQStringList fileList, TQString archiveName, TQString mimetype, bool remove) { Q_UNUSED( remove ); // create a new archive KTar archive(archiveName, mimetype); if (!archive.open(IO_WriteOnly)) { KMessageBox::error( m_parent, i18n("Error while trying to create archive file.") ); - return QString::null; + return TQString::null; } // add files to this archive - QStringList::const_iterator it; + TQStringList::const_iterator it; for (it = fileList.constBegin(); it != fileList.constEnd(); ++it) { #if KDE_IS_VERSION( 3, 5, 0 ) // Try to get a local URL instead of a remote one @@ -188,7 +188,7 @@ QString KBabelMailer::buildArchive(QStringList fileList, QString archiveName, QS #else const KURL url( KURL::fromPathOrURL( *it ) ); #endif - QString poTempName; + TQString poTempName; if ( !KIO::NetAccess::download( url, poTempName, m_parent ) ) { KMessageBox::error( m_parent, i18n("Error while trying to read file %1.").arg( url.prettyURL() ) ); continue; @@ -198,11 +198,11 @@ QString KBabelMailer::buildArchive(QStringList fileList, QString archiveName, QS // but only if "PoBaseDir" in the config file is set and the files // actually reside in one of its subdirectories. Else they are stored // without relative path. - QString poArchFileName = url.path(); + TQString poArchFileName = url.path(); if (_poBaseDir.isEmpty( ) || poArchFileName.find(_poBaseDir) != 0) - poArchFileName = QFileInfo( poArchFileName ).fileName(); + poArchFileName = TQFileInfo( poArchFileName ).fileName(); else - poArchFileName.remove( QRegExp( "^" + QRegExp::escape( _poBaseDir ) + "/?" ) ); + poArchFileName.remove( TQRegExp( "^" + TQRegExp::escape( _poBaseDir ) + "/?" ) ); if ( !archive.addLocalFile( poTempName, poArchFileName ) ) { KMessageBox::error( m_parent, i18n("Error while trying to copy file %1 into archive.").arg( url.prettyURL() ) ); diff --git a/kbabel/common/kbmailer.h b/kbabel/common/kbmailer.h index 7df5ce9d..c83c9371 100644 --- a/kbabel/common/kbmailer.h +++ b/kbabel/common/kbmailer.h @@ -66,7 +66,7 @@ class KDE_EXPORT KBabelMailer * @param project The project to be used. * @since 1.11.2 (KDE 3.5.2): @p parent parameter */ - KBabelMailer( QWidget* parent, Project::Ptr project); + KBabelMailer( TQWidget* parent, Project::Ptr project); virtual ~KBabelMailer(); /** @@ -75,7 +75,7 @@ class KDE_EXPORT KBabelMailer * * @param fileName the name of the file to be sent. */ - void sendOneFile(const QString& fileName); + void sendOneFile(const TQString& fileName); /** * Send only one file as a mail attachment. The file can either be sent * as a compressed or an uncompressed file. @@ -91,13 +91,13 @@ class KDE_EXPORT KBabelMailer * @param fileList contains the names of the files to be sent. * @param initialName the possible name of the archive */ - void sendFiles(QStringList fileList, const QString& initialName = QString::null); + void sendFiles(TQStringList fileList, const TQString& initialName = TQString::null); /** * Sets the the PO files' base directory. * * @param dir the PO file base dir. */ - void setPOBaseDir(const QString& dir) { _poBaseDir = dir; } + void setPOBaseDir(const TQString& dir) { _poBaseDir = dir; } /** @@ -109,14 +109,14 @@ class KDE_EXPORT KBabelMailer * name is queried. * * @return name of the archive if it was created successfully, - * otherwise QString::null. + * otherwise TQString::null. */ - QString createArchive(QStringList fileList, QString initialName); + TQString createArchive(TQStringList fileList, TQString initialName); /** * Write the archive file. */ - QString buildArchive(QStringList fileList, QString fileName, QString mimetype, bool remove = true); + TQString buildArchive(TQStringList fileList, TQString fileName, TQString mimetype, bool remove = true); private: /** * Read the config file to extract the values for compression @@ -145,9 +145,9 @@ class KDE_EXPORT KBabelMailer */ bool singleFileCompression; /** - * This QStringList stores the recently used archive names. + * This TQStringList stores the recently used archive names. */ - QStringList archiveList; + TQStringList archiveList; /** * The project object. */ @@ -155,10 +155,10 @@ class KDE_EXPORT KBabelMailer /** * The path to the PO Base directory */ - QString _poBaseDir; + TQString _poBaseDir; /// The parent widget - QWidget* m_parent; + TQWidget* m_parent; }; } diff --git a/kbabel/common/kbproject.cpp b/kbabel/common/kbproject.cpp index 38996b51..73ac9dbd 100644 --- a/kbabel/common/kbproject.cpp +++ b/kbabel/common/kbproject.cpp @@ -36,7 +36,7 @@ #include "kbprojectmanager.h" #include "kbprojectsettings.h" -#include <qfileinfo.h> +#include <tqfileinfo.h> #include <kdebug.h> #include <klocale.h> @@ -47,15 +47,15 @@ namespace KBabel { -Project::Project( const QString& file ) : - QObject () +Project::Project( const TQString& file ) : + TQObject () , _filename (file) , _name (i18n("unnamed")) , _valid (false) , _config (NULL) , _settings (NULL) { - QFileInfo info(file); + TQFileInfo info(file); if(info.isDir()) return; @@ -96,12 +96,12 @@ Project::Project( const QString& file ) : // read the project name _config->setGroup( "Project" ); - _name = _config->readEntry( "Name", QString() ); + _name = _config->readEntry( "Name", TQString() ); if ( _name.isEmpty() ) _name = "Default-Project"; // set default project name // ### FIXME: why is the Version number not written to the project file? - if ( _config->readEntry( "Version", QString() ) != "1.0.1" ) + if ( _config->readEntry( "Version", TQString() ) != "1.0.1" ) { kdWarning() << "Old project format assumed" << endl; @@ -266,7 +266,7 @@ MiscSettings Project::miscSettings () { MiscSettings settings; - QString temp=_settings->accelMarker(); + TQString temp=_settings->accelMarker(); if(temp.length() > 0) { settings.accelMarker=temp[0]; diff --git a/kbabel/common/kbproject.h b/kbabel/common/kbproject.h index 1e1ebc79..4c3d6fc7 100644 --- a/kbabel/common/kbproject.h +++ b/kbabel/common/kbproject.h @@ -33,7 +33,7 @@ #ifndef KBPROJECT_H #define KBPROJECT_H -#include <qstring.h> +#include <tqstring.h> #include <kconfig.h> #include "catalogsettings.h" @@ -43,19 +43,19 @@ namespace KBabel { class ProjectSettingsBase; - class KDE_EXPORT Project : public QObject, public KShared + class KDE_EXPORT Project : public TQObject, public KShared { Q_OBJECT public: typedef KSharedPtr <Project> Ptr; - Project( const QString& file ); + Project( const TQString& file ); virtual ~Project (); - QString filename () const { return _filename; } - QString name () const { return _name; } + TQString filename () const { return _filename; } + TQString name () const { return _name; } - void setName( const QString& name ) { _name = name; } + void setName( const TQString& name ) { _name = name; } KConfig* config (); /** @@ -97,8 +97,8 @@ namespace KBabel void signalSettingsChanged(); private: - QString _filename; - QString _name; + TQString _filename; + TQString _name; bool _valid; KSharedConfig::Ptr _config; ProjectSettingsBase* _settings; diff --git a/kbabel/common/kbprojectmanager.cpp b/kbabel/common/kbprojectmanager.cpp index 048c530a..ab117c97 100644 --- a/kbabel/common/kbprojectmanager.cpp +++ b/kbabel/common/kbprojectmanager.cpp @@ -39,15 +39,15 @@ namespace KBabel { -QPtrList<Project> ProjectManager::p_list; -QString ProjectManager::strDefaultProjectName = QString(); +TQPtrList<Project> ProjectManager::p_list; +TQString ProjectManager::strDefaultProjectName = TQString(); -Project::Ptr ProjectManager::open( const QString& file ) +Project::Ptr ProjectManager::open( const TQString& file ) { kdDebug() << k_funcinfo << " " << file << endl; // TODO: ensure full path // TODO: isn't a map better? - for(QPtrList<Project>::ConstIterator it = p_list.constBegin(); + for(TQPtrList<Project>::ConstIterator it = p_list.constBegin(); it != p_list.constEnd(); ++it) { if ((*it)->filename() == file) @@ -77,7 +77,7 @@ void ProjectManager::close( Project::Ptr project) project->config()->sync(); } -QString ProjectManager::defaultProjectName( void ) +TQString ProjectManager::defaultProjectName( void ) { if ( strDefaultProjectName.isEmpty() ) strDefaultProjectName = locateLocal("config", "kbabel.defaultproject" ); diff --git a/kbabel/common/kbprojectmanager.h b/kbabel/common/kbprojectmanager.h index 418183bb..abfce3e4 100644 --- a/kbabel/common/kbprojectmanager.h +++ b/kbabel/common/kbprojectmanager.h @@ -33,8 +33,8 @@ #ifndef KBPROJECTMANAGER_H #define KBPROJECTMANAGER_H -#include <qstring.h> -#include <qptrlist.h> +#include <tqstring.h> +#include <tqptrlist.h> #include <kdemacros.h> #include "kbproject.h" @@ -45,16 +45,16 @@ namespace KBabel class KDE_EXPORT ProjectManager { public: - static Project::Ptr open( const QString& file ); + static Project::Ptr open( const TQString& file ); static void close( Project::Ptr project ); static Project::Ptr create(); - static QString defaultProjectName( void ); + static TQString defaultProjectName( void ); friend class Project; private: static void remove (Project*); - static QPtrList<Project> p_list; - static QString strDefaultProjectName; + static TQPtrList<Project> p_list; + static TQString strDefaultProjectName; }; } diff --git a/kbabel/common/msgfmt.cpp b/kbabel/common/msgfmt.cpp index ef8ca895..61525a2f 100644 --- a/kbabel/common/msgfmt.cpp +++ b/kbabel/common/msgfmt.cpp @@ -35,33 +35,33 @@ #include <kapplication.h> #include <kprocess.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qfile.h> -#include <qregexp.h> -#include <qtextstream.h> -#include <qstring.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqregexp.h> +#include <tqtextstream.h> +#include <tqstring.h> #include <stdlib.h> using namespace KBabel; -Msgfmt::Msgfmt(QObject* parent,const char* name) - : QObject(parent , name) +Msgfmt::Msgfmt(TQObject* parent,const char* name) + : TQObject(parent , name) { } -Msgfmt::Status Msgfmt::checkSyntax(QString file,QString& output, bool gnu) +Msgfmt::Status Msgfmt::checkSyntax(TQString file,TQString& output, bool gnu) { Status stat=Ok; // this method does not return the right retrun values at the moment :-( KProcess proc; - connect(&proc,SIGNAL(receivedStdout(KProcess*, char*, int)), - this,SLOT(addToOutput(KProcess*,char *, int ))); - connect(&proc,SIGNAL(receivedStderr(KProcess *, char *, int)), - this,SLOT(addToOutput(KProcess*,char *, int))); + connect(&proc,TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this,TQT_SLOT(addToOutput(KProcess*,char *, int ))); + connect(&proc,TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + this,TQT_SLOT(addToOutput(KProcess*,char *, int))); // remove last output _output=""; @@ -80,7 +80,7 @@ Msgfmt::Status Msgfmt::checkSyntax(QString file,QString& output, bool gnu) } else if(proc.normalExit()) { - if( proc.exitStatus() || _output.contains(QRegExp("^.+:\\d+:")) ) // little workaround :-( + if( proc.exitStatus() || _output.contains(TQRegExp("^.+:\\d+:")) ) // little workaround :-( stat=SyntaxError; } else @@ -92,7 +92,7 @@ Msgfmt::Status Msgfmt::checkSyntax(QString file,QString& output, bool gnu) return stat; } -Msgfmt::Status Msgfmt::checkSyntaxInDir(QString dir,QString regexp,QString& output) +Msgfmt::Status Msgfmt::checkSyntaxInDir(TQString dir,TQString regexp,TQString& output) { Status stat=Ok; @@ -100,10 +100,10 @@ Msgfmt::Status Msgfmt::checkSyntaxInDir(QString dir,QString regexp,QString& outp KProcess proc; proc.setUseShell(true); - connect(&proc,SIGNAL(receivedStdout(KProcess*, char*, int)), - this,SLOT(addToOutput(KProcess*,char *, int ))); - connect(&proc,SIGNAL(receivedStderr(KProcess *, char *, int)), - this,SLOT(addToOutput(KProcess*,char *, int))); + connect(&proc,TQT_SIGNAL(receivedStdout(KProcess*, char*, int)), + this,TQT_SLOT(addToOutput(KProcess*,char *, int ))); + connect(&proc,TQT_SIGNAL(receivedStderr(KProcess *, char *, int)), + this,TQT_SLOT(addToOutput(KProcess*,char *, int))); // remove last output _output=""; @@ -117,7 +117,7 @@ Msgfmt::Status Msgfmt::checkSyntaxInDir(QString dir,QString regexp,QString& outp } else if(proc.normalExit()) { - if( proc.exitStatus() || _output.contains(QRegExp("^.+:\\d+:")) ) // little workaround :-( + if( proc.exitStatus() || _output.contains(TQRegExp("^.+:\\d+:")) ) // little workaround :-( stat=SyntaxError; } else @@ -133,13 +133,13 @@ Msgfmt::Status Msgfmt::checkSyntaxInDir(QString dir,QString regexp,QString& outp void Msgfmt::addToOutput(KProcess*,char *buffer, int buflen) { - QString newString = QString::fromLocal8Bit(buffer, buflen); + TQString newString = TQString::fromLocal8Bit(buffer, buflen); _output+=newString; } -QString Msgfmt::tempSaveName() +TQString Msgfmt::tempSaveName() { return kapp->tempSaveName("/tmp/kbabel_msgfmt.po"); } diff --git a/kbabel/common/msgfmt.h b/kbabel/common/msgfmt.h index bf983b2f..846501c1 100644 --- a/kbabel/common/msgfmt.h +++ b/kbabel/common/msgfmt.h @@ -33,7 +33,7 @@ #ifndef MSGFMT_H #define MSGFMT_H -#include <qobject.h> +#include <tqobject.h> #include <kdemacros.h> class KProcess; @@ -47,17 +47,17 @@ class KDE_EXPORT Msgfmt : private QObject Q_OBJECT public: enum Status{NoExecutable,Ok,SyntaxError,HeaderError,Error,Unsupported}; - Msgfmt(QObject* parent=0,const char* name=0); + Msgfmt(TQObject* parent=0,const char* name=0); - Status checkSyntax(QString file,QString& output, bool gnu = false); - Status checkSyntaxInDir(QString dir,QString regexp,QString& output); + Status checkSyntax(TQString file,TQString& output, bool gnu = false); + Status checkSyntaxInDir(TQString dir,TQString regexp,TQString& output); private slots: void addToOutput(KProcess*,char *buffer, int buflen); private: - static QString tempSaveName(); - QString _output; + static TQString tempSaveName(); + TQString _output; }; } diff --git a/kbabel/common/poinfo.cpp b/kbabel/common/poinfo.cpp index b7beba7d..68e13da8 100644 --- a/kbabel/common/poinfo.cpp +++ b/kbabel/common/poinfo.cpp @@ -42,13 +42,13 @@ #include <kstandarddirs.h> #include <ksavefile.h> -#include <qdatastream.h> -#include <qdatetime.h> -#include <qdict.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qregexp.h> -#include <qtextcodec.h> +#include <tqdatastream.h> +#include <tqdatetime.h> +#include <tqdict.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqregexp.h> +#include <tqtextcodec.h> #include "libgettext/pofiles.h" #include "libgettext/tokens.h" @@ -61,10 +61,10 @@ using namespace KBabel; struct poInfoCacheItem { PoInfo info; - QDateTime lastModified; + TQDateTime lastModified; }; -inline QDataStream& operator << ( QDataStream& stream, poInfoCacheItem* item ) +inline TQDataStream& operator << ( TQDataStream& stream, poInfoCacheItem* item ) { // Note: if you change anything here, do not forget to increase the #define POINFOCACHE_VERSION stream << item->info.total; @@ -84,7 +84,7 @@ inline QDataStream& operator << ( QDataStream& stream, poInfoCacheItem* item ) return stream; } -inline QDataStream& operator >> ( QDataStream& stream, poInfoCacheItem* item ) +inline TQDataStream& operator >> ( TQDataStream& stream, poInfoCacheItem* item ) { stream >> item->info.total; stream >> item->info.fuzzy; @@ -104,10 +104,10 @@ inline QDataStream& operator >> ( QDataStream& stream, poInfoCacheItem* item ) } // Cache of PO-file items -static QDict<poInfoCacheItem> _poInfoCache; +static TQDict<poInfoCacheItem> _poInfoCache; // File name of cache -static QString _poInfoCacheName; +static TQString _poInfoCacheName; // flag to stop current reading bool PoInfo::stopStaticRead; @@ -117,9 +117,9 @@ bool PoInfo::_gettextPluralForm; // Note: We only read the cache file if the data seems usable. If not, we will re-generate the data. void PoInfo::cacheRead() { - QFile cacheFile( _poInfoCacheName ); + TQFile cacheFile( _poInfoCacheName ); if( cacheFile.open( IO_ReadOnly ) ) { - QDataStream s( &cacheFile ); + TQDataStream s( &cacheFile ); // Check the file cache version. // If it is not the current version, we do not read the cache file @@ -132,13 +132,13 @@ void PoInfo::cacheRead() } /* - * Check the version of the QDataStream with which the cache file was written + * Check the version of the TQDataStream with which the cache file was written * * If the cache file was written by an incompatible future version of Qt, * the cache file will not be read. * * On the other side, a cache file written by a previous version of Qt can be read, - * by setting the version of the QDataStream used. + * by setting the version of the TQDataStream used. */ Q_INT32 qdatastreamVersion; s >> qdatastreamVersion; @@ -146,12 +146,12 @@ void PoInfo::cacheRead() s.setVersion( qdatastreamVersion ); } else { - // QDataStream version seems stupid, so abort - kdDebug(KBABEL) << "Wrong QDataStream version: " << qdatastreamVersion << endl; + // TQDataStream version seems stupid, so abort + kdDebug(KBABEL) << "Wrong TQDataStream version: " << qdatastreamVersion << endl; return; } - QString url; + TQString url; while( !s.atEnd() ) { poInfoCacheItem* item = new poInfoCacheItem; s >> url; @@ -168,7 +168,7 @@ void PoInfo::cacheWrite() // (especially if two instances would write into the same cache file) KSaveFile cacheFile( _poInfoCacheName ); - QDataStream* stream = cacheFile.dataStream(); + TQDataStream* stream = cacheFile.dataStream(); if( stream ) { @@ -182,9 +182,9 @@ void PoInfo::cacheWrite() const Q_INT32 qdatastreamVersion = stream->version(); *stream << qdatastreamVersion; - QDictIterator<poInfoCacheItem> it( _poInfoCache ); // iterator for dict + TQDictIterator<poInfoCacheItem> it( _poInfoCache ); // iterator for dict for ( ; it.current(); ++it ) { - if( QFile::exists( it.currentKey() ) ) { + if( TQFile::exists( it.currentKey() ) ) { *stream << it.currentKey(); *stream << it.current(); } @@ -194,12 +194,12 @@ void PoInfo::cacheWrite() } } else { - kdWarning(KBABEL) << "Could not create QDataStream for cache file: " << _poInfoCacheName << endl; + kdWarning(KBABEL) << "Could not create TQDataStream for cache file: " << _poInfoCacheName << endl; cacheFile.abort(); } } -bool PoInfo::cacheFind(const QString url, PoInfo& info) +bool PoInfo::cacheFind(const TQString url, PoInfo& info) { // Read cache if it has not been read, and set up post routine to write it static bool _cacheIsRead = false; @@ -211,7 +211,7 @@ bool PoInfo::cacheFind(const QString url, PoInfo& info) poInfoCacheItem *item = _poInfoCache.find( url ); if( item ) { - QFileInfo fi( url ); + TQFileInfo fi( url ); if( fi.lastModified() == item->lastModified ) { info = item->info; @@ -221,29 +221,29 @@ bool PoInfo::cacheFind(const QString url, PoInfo& info) return false; } -void PoInfo::cacheSave(const QString url, PoInfo& info) +void PoInfo::cacheSave(const TQString url, PoInfo& info) { poInfoCacheItem *item = new poInfoCacheItem; - QFileInfo fi( url ); + TQFileInfo fi( url ); item->info = info; item->lastModified = fi.lastModified(); _poInfoCache.insert( url, item ); } -QTextCodec* PoInfo::codecForFile(QString gettextHeader) +TQTextCodec* PoInfo::codecForFile(TQString gettextHeader) { - QRegExp regexp("Content-Type:\\s*\\w+/[-\\w]+;?\\s*charset\\s*=\\s*(\\S+)\\s*\\\\n"); + TQRegExp regexp("Content-Type:\\s*\\w+/[-\\w]+;?\\s*charset\\s*=\\s*(\\S+)\\s*\\\\n"); if( regexp.search(gettextHeader) == -1 ) { kdDebug(KBABEL) << "no charset entry found" << endl; return 0; } - const QString charset = regexp.cap(1); + const TQString charset = regexp.cap(1); kdDebug(KBABEL) << "charset: " << charset << endl; - QTextCodec* codec=0; + TQTextCodec* codec=0; if(!charset.isEmpty()) { @@ -252,27 +252,27 @@ QTextCodec* PoInfo::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(KBABEL) << "charset found, but no codec available, using UTF8 instead" << endl; - codec=QTextCodec::codecForName("utf8"); + codec=TQTextCodec::codecForName("utf8"); } } else { // No charset? So it is probably ASCII, therefore UTF-8 kdWarning(KBABEL) << "No charset defined! Assuming UTF-8!" << endl; - codec=QTextCodec::codecForName("utf8"); + codec=TQTextCodec::codecForName("utf8"); } return codec; @@ -285,12 +285,12 @@ PoInfo PoInfo::headerInfo(const CatalogItem& headerItem) // Note that the "line" defined by the \n can be different than the line of the file. // We join all lines of the header and then split the result again at the \n sequence - const QStringList header=QStringList::split("\\n",headerItem.msgstrAsList().join(QString())); + const TQStringList header=TQStringList::split("\\n",headerItem.msgstrAsList().join(TQString())); PoInfo info; // extract information from the header - QStringList::const_iterator it; + TQStringList::const_iterator it; // The header of a Gettext .po file is consisted of lines of key and value for(it=header.begin();it!=header.end();++it) @@ -301,8 +301,8 @@ PoInfo PoInfo::headerInfo(const CatalogItem& headerItem) if (res>=0) { knownKey=true; // We know most keys, if not it will be changed to false in the "else" case - const QString key=(*it).left(res).simplifyWhiteSpace(); - QString value=(*it).mid(res+1); + const TQString key=(*it).left(res).simplifyWhiteSpace(); + TQString value=(*it).mid(res+1); // "Chop" the \n at the end if (value.endsWith("\\n")) value.remove(value.length()-2,2); // ### Qt4: use value.chop(2) @@ -332,7 +332,7 @@ PoInfo PoInfo::headerInfo(const CatalogItem& headerItem) } if (!knownKey) { - QString line=(*it); + TQString line=(*it); if(line.right(2)=="\\n") line.remove(line.length()-2,2); // ### Qt4: use value.chop(2) @@ -350,28 +350,28 @@ PoInfo PoInfo::headerInfo(const CatalogItem& headerItem) } -ConversionStatus PoInfo::info(const QString& url, PoInfo& info, QStringList &wordList, bool updateWordList, bool interactive) +ConversionStatus PoInfo::info(const TQString& url, PoInfo& info, TQStringList &wordList, bool updateWordList, bool interactive) { return PoInfo::info( url, info, wordList, updateWordList, interactive, true); } -ConversionStatus PoInfo::info(const QString& url, PoInfo& info, QStringList &wordList, bool updateWordList, bool interactive, bool msgfmt) +ConversionStatus PoInfo::info(const TQString& url, PoInfo& info, TQStringList &wordList, bool updateWordList, bool interactive, bool msgfmt) { stopStaticRead = false; if( !updateWordList && PoInfo::cacheFind( url, info ) ) return OK; - QString target; + TQString target; if(KIO::NetAccess::download(KURL( url ), target, 0)) { - QFile file(target); + TQFile file(target); if ( msgfmt ) { // First check file with msgfmt to be sure, it is syntactically correct Msgfmt msgfmt; - QString output; + TQString output; Msgfmt::Status stat = msgfmt.checkSyntax( target , output ); if(stat == Msgfmt::SyntaxError) { @@ -422,7 +422,7 @@ ConversionStatus PoInfo::info(const QString& url, PoInfo& info, QStringList &wor if( temp.isFuzzy() ) temp.removeFuzzy(); //find out the codec - QTextCodec* codec = codecForFile( temp.msgstr().first() ); + TQTextCodec* codec = codecForFile( temp.msgstr().first() ); if( !codec ) return PARSE_ERROR; // convert from UTF-8 using codec @@ -447,27 +447,27 @@ ConversionStatus PoInfo::info(const QString& url, PoInfo& info, QStringList &wor if( updateWordList ) { // FIXME: should care about plural forms in msgid - QString st = temp.msgid().first().simplifyWhiteSpace().lower(); - QStringList sl = QStringList::split( ' ', st ); + TQString st = temp.msgid().first().simplifyWhiteSpace().lower(); + TQStringList sl = TQStringList::split( ' ', st ); while(!sl.isEmpty()) { - QString w = sl.first(); + TQString w = sl.first(); sl.pop_front(); if( !wordList.contains(w) ) wordList.append( w ); } st = temp.msgstr().join(" " ).simplifyWhiteSpace().lower(); - sl = QStringList::split( ' ', st ); + sl = TQStringList::split( ' ', st ); while(!sl.isEmpty()) { - QString w = sl.first(); + TQString w = sl.first(); sl.pop_front(); if( !wordList.contains(w) ) wordList.append( w ); } st = temp.comment().simplifyWhiteSpace().lower(); - sl = QStringList::split( ' ', st ); + sl = TQStringList::split( ' ', st ); while(!sl.isEmpty()) { - QString w = sl.first(); + TQString w = sl.first(); sl.pop_front(); if( !wordList.contains(w) ) wordList.append( w ); } @@ -504,12 +504,12 @@ ConversionStatus PoInfo::info(const QString& url, PoInfo& info, QStringList &wor return OK; } -bool PoInfo::findInFile( const QString& url, FindOptions options ) +bool PoInfo::findInFile( const TQString& url, FindOptions options ) { enum {Begin, Comment, Msgid, Msgstr, Msgctxt} part = Begin; stopStaticRead = false; - QString target; + TQString target; if(KIO::NetAccess::download(KURL( url ), target, 0)) { std::ifstream* stream = new std::ifstream( target.local8Bit()); @@ -523,8 +523,8 @@ bool PoInfo::findInFile( const QString& url, FindOptions options ) // prepare the search - QString searchStr = options.findStr; - QRegExp regexp( searchStr ); + TQString searchStr = options.findStr; + TQRegExp regexp( searchStr ); if( options.isRegExp ) regexp.setCaseSensitive( options.caseSensitive ); @@ -540,14 +540,14 @@ bool PoInfo::findInFile( const QString& url, FindOptions options ) return false; // header is not at the beginning, broken file } - QTextCodec* codec = codecForFile( temp.msgstr().first() ); + TQTextCodec* codec = codecForFile( temp.msgstr().first() ); if( !codec ) { return false; } // now parse the rest of the file - QString text; + TQString text; int pos,len; while(lexer->lastToken != T_EOF) @@ -565,10 +565,10 @@ bool PoInfo::findInFile( const QString& url, FindOptions options ) { if( options.wholeWords) { len = searchStr.length(); - QString pre = text.mid(pos-1,1); - QString post = text.mid(pos+len,1); - if( !pre.contains( QRegExp("[a-zA-Z0-9]")) && - !post.contains( QRegExp("[a-zA-Z0-9]") ) + TQString pre = text.mid(pos-1,1); + TQString post = text.mid(pos+len,1); + if( !pre.contains( TQRegExp("[a-zA-Z0-9]")) && + !post.contains( TQRegExp("[a-zA-Z0-9]") ) ) { delete lexer; delete stream; @@ -615,10 +615,10 @@ bool PoInfo::findInFile( const QString& url, FindOptions options ) { if( options.wholeWords) { len = searchStr.length(); - QString pre = text.mid(pos-1,1); - QString post = text.mid(pos+len,1); - if( !pre.contains( QRegExp("[a-zA-Z0-9]")) && - !post.contains( QRegExp("[a-zA-Z0-9]") ) + TQString pre = text.mid(pos-1,1); + TQString post = text.mid(pos+len,1); + if( !pre.contains( TQRegExp("[a-zA-Z0-9]")) && + !post.contains( TQRegExp("[a-zA-Z0-9]") ) ) { delete lexer; delete stream; @@ -674,9 +674,9 @@ ConversionStatus PoInfo::fastRead( CatalogItem& item, GettextFlexLexer *lexer, b // comment if( lexer->lastToken == T_COMMENT ) { - QString _comment = QString::fromUtf8(lexer->YYText()); + TQString _comment = TQString::fromUtf8(lexer->YYText()); while( lexer->yylex() == T_COMMENT ) - _comment += "\n"+QString::fromUtf8(lexer->YYText()); + _comment += "\n"+TQString::fromUtf8(lexer->YYText()); item.setComment( _comment ); // kdDebug(KBABEL) << "Comment: " << _comment << endl; } @@ -700,12 +700,12 @@ ConversionStatus PoInfo::fastRead( CatalogItem& item, GettextFlexLexer *lexer, b if( lexer->lastToken != T_MSGID ) return PARSE_ERROR; if( lexer->yylex() != T_STRING ) return PARSE_ERROR; - QStringList msgids = item.msgid(); - QStringList::Iterator it = msgids.begin(); - *it = QString::fromUtf8(lexer->YYText()); + TQStringList msgids = item.msgid(); + TQStringList::Iterator it = msgids.begin(); + *it = TQString::fromUtf8(lexer->YYText()); if( storeText ) while( lexer->yylex() == T_STRING ) - (*it) += ("\n"+ QString::fromUtf8(lexer->YYText()) ); + (*it) += ("\n"+ TQString::fromUtf8(lexer->YYText()) ); else { if( lexer->yylex() == T_STRING ) // this is not header { @@ -721,12 +721,12 @@ ConversionStatus PoInfo::fastRead( CatalogItem& item, GettextFlexLexer *lexer, b { _gettextPluralForm = true; if( lexer->yylex() != T_STRING ) return PARSE_ERROR; - QStringList msgids = item.msgid(); + TQStringList msgids = item.msgid(); it = msgids.fromLast(); - *it = QString::fromUtf8(lexer->YYText()); + *it = TQString::fromUtf8(lexer->YYText()); if( storeText ) while( lexer->yylex() == T_STRING ) - (*it)+="\n"+ QString::fromUtf8(lexer->YYText()); + (*it)+="\n"+ TQString::fromUtf8(lexer->YYText()); else while( lexer->yylex() == T_STRING ); item.setMsgid( msgids ); // kdDebug(KBABEL) << "Msgid_plural: " << *it << endl; @@ -739,12 +739,12 @@ ConversionStatus PoInfo::fastRead( CatalogItem& item, GettextFlexLexer *lexer, b { if( lexer->yylex() != T_STRING ) return PARSE_ERROR; - QStringList msgstrs = item.msgstr(); + TQStringList msgstrs = item.msgstr(); it = msgstrs.begin(); - *it = QString::fromUtf8(lexer->YYText()); + *it = TQString::fromUtf8(lexer->YYText()); if( storeText || item.msgid().first().isEmpty() ) // if we should store the text or it is a header while( lexer->yylex() == T_STRING ) - (*it)+= ("\n"+ QString::fromUtf8(lexer->YYText())); + (*it)+= ("\n"+ TQString::fromUtf8(lexer->YYText())); else if( lexer->yylex() == T_STRING ) // check next token, whether it is really translated { @@ -756,21 +756,21 @@ ConversionStatus PoInfo::fastRead( CatalogItem& item, GettextFlexLexer *lexer, b } else { - QStringList msgstrs = item.msgstr(); - QString s = QString::fromUtf8(lexer->YYText()); - while( lexer->lastToken == T_MSGSTR && s.contains( QRegExp("^msgstr\\[[0-9]+\\]" ) ) ) + TQStringList msgstrs = item.msgstr(); + TQString s = TQString::fromUtf8(lexer->YYText()); + while( lexer->lastToken == T_MSGSTR && s.contains( TQRegExp("^msgstr\\[[0-9]+\\]" ) ) ) { if( lexer->yylex() != T_STRING ) return PARSE_ERROR; it = msgstrs.fromLast(); - *it = QString::fromUtf8(lexer->YYText()); + *it = TQString::fromUtf8(lexer->YYText()); if( storeText ) do { - (*it)+="\n"+QString::fromUtf8(lexer->YYText()); + (*it)+="\n"+TQString::fromUtf8(lexer->YYText()); } while( lexer->yylex() == T_STRING ); else while( lexer->yylex() == T_STRING ); // kdDebug(KBABEL) << "Msgstr: " << *it << endl; - s = QString::fromUtf8(lexer->YYText()); + s = TQString::fromUtf8(lexer->YYText()); } item.setMsgstr( msgstrs ); } diff --git a/kbabel/common/poinfo.h b/kbabel/common/poinfo.h index 21b8d72d..830d35eb 100644 --- a/kbabel/common/poinfo.h +++ b/kbabel/common/poinfo.h @@ -38,7 +38,7 @@ #include <kdebug.h> -#include <qstring.h> +#include <tqstring.h> /** * @brief File cache version number. @@ -64,17 +64,17 @@ public: int fuzzy; int untranslated; - QString project; - QString creation; - QString revision; - QString lastTranslator; - QString languageTeam; - QString mimeVersion; - QString contentType; - QString encoding; - QString others; + TQString project; + TQString creation; + TQString revision; + TQString lastTranslator; + TQString languageTeam; + TQString mimeVersion; + TQString contentType; + TQString encoding; + TQString others; - QString headerComment; + TQString headerComment; /** * Find PO-file information in the cache. @@ -83,7 +83,7 @@ public: * @param info Returned cached information. * @return true if found, false otherwise. */ - static bool cacheFind(const QString url, PoInfo& info); + static bool cacheFind(const TQString url, PoInfo& info); /** * Save PO-file information in the cache. @@ -91,7 +91,7 @@ public: * @param url The URL of the PO-file. * @param info Information to save. */ - static void cacheSave(const QString url, PoInfo& info); + static void cacheSave(const TQString url, PoInfo& info); /** * @brief Get information about the PO file @@ -105,7 +105,7 @@ public: * being parsed? * @since KBabel 1.11 (KDE 3.5) */ - static ConversionStatus info(const QString& url,PoInfo& info, QStringList &wordList, bool updateWordList, bool interactive, bool msgfmt); + static ConversionStatus info(const TQString& url,PoInfo& info, TQStringList &wordList, bool updateWordList, bool interactive, bool msgfmt); /** * @brief Get information about the PO file @@ -121,10 +121,10 @@ public: * KBabel 1.11.1 (KDE 3.5.1) * @note This function always call Gettext's mgfmt before parsing each file */ - static ConversionStatus info(const QString& url,PoInfo& info, QStringList &wordList, bool updateWordList, bool interactive = true); + static ConversionStatus info(const TQString& url,PoInfo& info, TQStringList &wordList, bool updateWordList, bool interactive = true); static PoInfo headerInfo(const CatalogItem&); - static bool findInFile(const QString& url, FindOptions options ); + static bool findInFile(const TQString& url, FindOptions options ); static bool stopStaticRead; @@ -135,7 +135,7 @@ public: * * @return Codec for found charset or 0, if no information has been found */ - static QTextCodec* codecForFile(QString gettextHeader); + static TQTextCodec* codecForFile(TQString gettextHeader); /** * @brief Write the entire cache. diff --git a/kbabel/common/projectsettings.cpp b/kbabel/common/projectsettings.cpp index 3687c9d4..3f8f47a3 100644 --- a/kbabel/common/projectsettings.cpp +++ b/kbabel/common/projectsettings.cpp @@ -35,16 +35,16 @@ #include "projectsettings.h" #include "resources.h" -#include <qstring.h> +#include <tqstring.h> #include <kglobal.h> #include <klocale.h> #include <kstandarddirs.h> #include <kspell.h> -QString KBabel::Defaults::Spellcheck::ignoreURL() +TQString KBabel::Defaults::Spellcheck::ignoreURL() { - QString _ignoreURL; + TQString _ignoreURL; KStandardDirs * dirs = KGlobal::dirs(); if(dirs) @@ -89,7 +89,7 @@ int KBabel::Defaults::Spellcheck::spellClient() return defaultsettings->client(); } -QString KBabel::Defaults::Spellcheck::spellDictionary() +TQString KBabel::Defaults::Spellcheck::spellDictionary() { if( ! defaultsettings ) { @@ -109,9 +109,9 @@ int KBabel::Defaults::Spellcheck::spellEncoding() return defaultsettings->encoding(); } -QString KBabel::Defaults::CatalogManager::ignoreURL() +TQString KBabel::Defaults::CatalogManager::ignoreURL() { - QString _ignoreURL; + TQString _ignoreURL; KStandardDirs * dirs = KGlobal::dirs(); if(dirs) diff --git a/kbabel/common/projectsettings.h b/kbabel/common/projectsettings.h index 186b21e5..49afc0a6 100644 --- a/kbabel/common/projectsettings.h +++ b/kbabel/common/projectsettings.h @@ -35,10 +35,10 @@ #ifndef PROJECTSETTINGS_H #define PROJECTSETTINGS_H -#include <qstring.h> -#include <qstringlist.h> -#include <qfont.h> -#include <qcolor.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqfont.h> +#include <tqcolor.h> #include <kurl.h> #include "catalogsettings.h" @@ -54,10 +54,10 @@ struct SpellcheckSettings bool runTogether; int spellEncoding; int spellClient; - QString spellDict; + TQString spellDict; bool rememberIgnored; - QString ignoreURL; + TQString ignoreURL; bool onFlySpellcheck; @@ -66,17 +66,17 @@ struct SpellcheckSettings struct CatManSettings { - QString poBaseDir; - QString potBaseDir; + TQString poBaseDir; + TQString potBaseDir; bool openWindow; - QStringList dirCommands; - QStringList dirCommandNames; - QStringList fileCommands; - QStringList fileCommandNames; + TQStringList dirCommands; + TQStringList dirCommandNames; + TQStringList fileCommands; + TQStringList fileCommandNames; - QString ignoreURL; + TQString ignoreURL; bool killCmdOnExit; bool indexWords; @@ -99,16 +99,16 @@ struct SourceContextSettings * A path, which can be used as @CODEROOT@ variable in @ref sourcePaths . * Defaults to empty string. */ - QString codeRoot; + TQString codeRoot; /** * List of paths, where the source file should be lookup. Can use @CODEROOT@ (replaced by @ref codeRoot), * @PACKAGE@ (replaced by package name), @PACKAGEDIR@ (replaced by the * longest known path of the package) and @COMMENTPATH@ (path extracted from comment specs. */ - QStringList sourcePaths; + TQStringList sourcePaths; - void SourceContextSettins() { codeRoot = QString::null; sourcePaths.clear(); } + void SourceContextSettins() { codeRoot = TQString::null; sourcePaths.clear(); } }; /** @@ -120,11 +120,11 @@ namespace Defaults class KDE_EXPORT Spellcheck { public: - static QString ignoreURL(); + static TQString ignoreURL(); static bool noRootAffix(); static bool runTogether(); static int spellClient(); - static QString spellDictionary(); + static TQString spellDictionary(); static int spellEncoding(); private: static KSpellConfig* defaultsettings; @@ -133,7 +133,7 @@ namespace Defaults class KDE_EXPORT CatalogManager { public: - static QString ignoreURL(); + static TQString ignoreURL(); }; } diff --git a/kbabel/common/regexpextractor.cpp b/kbabel/common/regexpextractor.cpp index b69398c6..058834ea 100644 --- a/kbabel/common/regexpextractor.cpp +++ b/kbabel/common/regexpextractor.cpp @@ -35,18 +35,18 @@ #include "regexpextractor.h" #include <kdebug.h> -#include <qregexp.h> +#include <tqregexp.h> using namespace KBabel; -RegExpExtractor::RegExpExtractor(const QStringList& regexps) : +RegExpExtractor::RegExpExtractor(const TQStringList& regexps) : _regExpList( regexps ) { - _string=QString::null; + _string=TQString::null; _matches.setAutoDelete(true); } -void RegExpExtractor::setString(QString string) +void RegExpExtractor::setString(TQString string) { _string=string; processString(); @@ -57,17 +57,17 @@ uint RegExpExtractor::countMatches() return _matches.count(); } -QString RegExpExtractor::firstMatch() +TQString RegExpExtractor::firstMatch() { MatchedEntryInfo *ti = _matches.first(); if(ti) return ti->extracted; - return QString::null; + return TQString::null; } -QString RegExpExtractor::nextMatch() +TQString RegExpExtractor::nextMatch() { MatchedEntryInfo *ti=_matches.next(); if(!ti) @@ -76,16 +76,16 @@ QString RegExpExtractor::nextMatch() if(ti) return ti->extracted; - return QString::null; + return TQString::null; } -QString RegExpExtractor::match(uint tagnumber) +TQString RegExpExtractor::match(uint tagnumber) { MatchedEntryInfo *ti=_matches.at(tagnumber); if(ti) return ti->extracted; - return QString::null; + return TQString::null; } int RegExpExtractor::matchIndex(uint tagnumber) @@ -97,27 +97,27 @@ int RegExpExtractor::matchIndex(uint tagnumber) return -1; } -QString RegExpExtractor::prevMatch() +TQString RegExpExtractor::prevMatch() { MatchedEntryInfo *ti=_matches.prev(); if(ti) return ti->extracted; - return QString::null; + return TQString::null; } -QString RegExpExtractor::lastMatch() +TQString RegExpExtractor::lastMatch() { MatchedEntryInfo *ti=_matches.last(); if(ti) return ti->extracted; - return QString::null; + return TQString::null; } -QStringList RegExpExtractor::matches() +TQStringList RegExpExtractor::matches() { - QStringList list; + TQStringList list; MatchedEntryInfo *ti; for(ti=_matches.first(); ti!=0; ti = _matches.next()) { @@ -127,15 +127,15 @@ QStringList RegExpExtractor::matches() return list; } -QString RegExpExtractor::plainString(bool keepPos) +TQString RegExpExtractor::plainString(bool keepPos) { - QString tmp=_string; + TQString tmp=_string; MatchedEntryInfo *ti; for(ti=_matches.first(); ti != 0; ti=_matches.next()) { uint len=ti->extracted.length(); - QString s; + TQString s; for(uint i=0; i<len; i++) { s+=' '; @@ -151,9 +151,9 @@ QString RegExpExtractor::plainString(bool keepPos) return tmp; } -QString RegExpExtractor::matchesReplaced(const QString& replace) +TQString RegExpExtractor::matchesReplaced(const TQString& replace) { - QString tmp=_string; + TQString tmp=_string; int posCorrection=0; int replaceLen=replace.length(); @@ -177,20 +177,20 @@ void RegExpExtractor::processString() // if there is no regexp to be matched, quit if( regExpList().empty() ) return; - QValueList<MatchedEntryInfo> tmpList; + TQValueList<MatchedEntryInfo> tmpList; bool found=false; - QString tmp=_string; + TQString tmp=_string; do { found=false; - QStringList::Iterator it; + TQStringList::Iterator it; for(it=_regExpList.begin();it!=_regExpList.end();++it) { int pos=-1; - QString tag; + TQString tag; - QRegExp reg = QRegExp((*it)); + TQRegExp reg = TQRegExp((*it)); pos = reg.search(tmp); int len=reg.matchedLength(); @@ -208,7 +208,7 @@ void RegExpExtractor::processString() ti.extracted=tag; tmpList.append(ti); - QString s; + TQString s; for(uint i=0; i<tag.length(); i++) { s+=' '; @@ -228,7 +228,7 @@ void RegExpExtractor::processString() uint n= 0; uint min=_string.length(); uint counter=0; - QValueList<MatchedEntryInfo>::Iterator it; + TQValueList<MatchedEntryInfo>::Iterator it; for(it=tmpList.begin();it!=tmpList.end();++it) { if((*it).index < min) @@ -249,22 +249,22 @@ void RegExpExtractor::processString() } } -QStringList RegExpExtractor::regExpList() +TQStringList RegExpExtractor::regExpList() { return _regExpList; } -void RegExpExtractor::setRegExpList( const QStringList& regexps ) +void RegExpExtractor::setRegExpList( const TQStringList& regexps ) { _regExpList = regexps; } -void RegExpExtractor::addRegExpIdentifier(QString regExp) +void RegExpExtractor::addRegExpIdentifier(TQString regExp) { _regExpList.append(regExp); } -void RegExpExtractor::deleteRegExpIdentifier(QString regExp) +void RegExpExtractor::deleteRegExpIdentifier(TQString regExp) { _regExpList.remove(regExp); } diff --git a/kbabel/common/regexpextractor.h b/kbabel/common/regexpextractor.h index 89703fba..83ff8f60 100644 --- a/kbabel/common/regexpextractor.h +++ b/kbabel/common/regexpextractor.h @@ -34,11 +34,11 @@ #ifndef _REGEXP_EXTRACTOR_H_ #define _REGEXP_EXTRACTOR_H_ -#include <qptrlist.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qvaluelist.h> -#include <qregexp.h> +#include <tqptrlist.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqvaluelist.h> +#include <tqregexp.h> #include <kdemacros.h> namespace KBabel @@ -46,7 +46,7 @@ namespace KBabel struct KDE_EXPORT MatchedEntryInfo{ uint index; - QString extracted; + TQString extracted; }; @@ -61,14 +61,14 @@ public: /** * Create a regexp extractor for "string" */ - RegExpExtractor(const QStringList& regexps); + RegExpExtractor(const TQStringList& regexps); virtual ~RegExpExtractor() {} /** * Set the string of this extractor */ - void setString(QString string); + void setString(TQString string); /** * @return the number of matches found @@ -79,17 +79,17 @@ public: * @return the first match, and set the internal cursor to * the beginning */ - QString firstMatch(); + TQString firstMatch(); /** * @return the next match and move cursor forward */ - QString nextMatch(); + TQString nextMatch(); /** * @return the n-th match. It also moves the cursor. */ - QString match(uint matchnumber); + TQString match(uint matchnumber); /** * @return the n-th match. It also moves the cursor. -1 is there @@ -100,17 +100,17 @@ public: /** * @return the next match and move cursor forward */ - QString prevMatch(); + TQString prevMatch(); /** * @return the last match and move the cursor to the end */ - QString lastMatch(); + TQString lastMatch(); /** * @return a list of all matches */ - QStringList matches(); + TQStringList matches(); /** * @return the string without matched text @@ -120,36 +120,36 @@ public: * the matches are replaced with ' ' and therefore the position of the * words will not change */ - QString plainString(bool keepPos=false); + TQString plainString(bool keepPos=false); /** * @return the string, where matches are replaced with the given string */ - QString matchesReplaced(const QString& replace); + TQString matchesReplaced(const TQString& replace); //Functions that allow user to define his own regexps. /** * Add a regexp to the list of regexp identifier. */ - void addRegExpIdentifier(QString regexp); + void addRegExpIdentifier(TQString regexp); /** * Delete from the regexp list the regexp. */ - void deleteRegExpIdentifier(QString regexp); + void deleteRegExpIdentifier(TQString regexp); - void setRegExpList( const QStringList& regexps ); + void setRegExpList( const TQStringList& regexps ); - QStringList regExpList(); + TQStringList regExpList(); protected: void processString(); - QPtrList<MatchedEntryInfo> _matches; - QString _string; - QStringList _regExpList; + TQPtrList<MatchedEntryInfo> _matches; + TQString _string; + TQStringList _regExpList; }; diff --git a/kbabel/common/stringdistance.cpp b/kbabel/common/stringdistance.cpp index 32cb9b96..8de11c98 100644 --- a/kbabel/common/stringdistance.cpp +++ b/kbabel/common/stringdistance.cpp @@ -46,7 +46,7 @@ const int LevenshteinDistance::editCost_insert = 1; const int LevenshteinDistance::editCost_delete = 1; -double relativeDistance(double distance, const QString& left_string, const QString& right_string) +double relativeDistance(double distance, const TQString& left_string, const TQString& right_string) { double maxsize=0; double compsize=0; @@ -63,7 +63,7 @@ double relativeDistance(double distance, const QString& left_string, const QStri * This function sums all the distances between all trees. * For the calculation of the distance between two trees, it calls the function calculate. */ -double Distance::operator()(const QString& left_string, const QString& right_string) +double Distance::operator()(const TQString& left_string, const TQString& right_string) { m_distance = 0.00; if (left_string == right_string) @@ -86,7 +86,7 @@ double Distance::operator()(const QString& left_string, const QString& right_str /** This function calculates the distance between two nodes. * For the calculation you can specify two variables gap & distance. */ -int Distance::nodeDistance(const QString& left_letter, const QString& right_letter) +int Distance::nodeDistance(const TQString& left_letter, const TQString& right_letter) { if ( left_letter == right_letter ) { @@ -105,7 +105,7 @@ int Distance::nodeDistance(const QString& left_letter, const QString& right_lett * This function sums all the distances between all nodes. * For the calculation you can specify the distance between two nodes in variable distance */ -double HammingDistance::calculate(const QString& left_string, const QString& right_string) +double HammingDistance::calculate(const TQString& left_string, const TQString& right_string) { double hammingDistance = 0.00; // if (debug > 0) @@ -135,7 +135,7 @@ double HammingDistance::calculate(const QString& left_string, const QString& rig * A matrice D is generated which represent the distribution of distances between two trees. * The last element represent the Levenshtein-distance. */ -double LevenshteinDistance::calculate(const QString& left_string, const QString& right_string) +double LevenshteinDistance::calculate(const TQString& left_string, const TQString& right_string) { // if (debug > 0) // cout << left_string.length() << " " << right_string.length() << "\t"; diff --git a/kbabel/common/stringdistance.h b/kbabel/common/stringdistance.h index 6f5aa185..89c60627 100644 --- a/kbabel/common/stringdistance.h +++ b/kbabel/common/stringdistance.h @@ -34,7 +34,7 @@ #ifndef STRINGDISTANCE_H #define STRINGDISTANCE_H -#include <qstring.h> +#include <tqstring.h> //#include <boost/numeric/ublas/matrix.hpp> @@ -69,20 +69,20 @@ class Distance : public NonCopyable { public: virtual ~Distance(){} - double operator()(const QString& left, const QString& right); + double operator()(const TQString& left, const TQString& right); int editCostReplace() { return editCost_replace_base; } static int debug; protected: - virtual double calculate(const QString& left_string, const QString& right_string) = 0; - int nodeDistance(const QString& left_letter, const QString& right_letter); + virtual double calculate(const TQString& left_string, const TQString& right_string) = 0; + int nodeDistance(const TQString& left_letter, const TQString& right_letter); static const int editCost_replace_base; double m_distance; }; -double relativeDistance(double distance, const QString& left_string, const QString right_string); +double relativeDistance(double distance, const TQString& left_string, const TQString right_string); /** @@ -96,7 +96,7 @@ double relativeDistance(double distance, const QString& left_string, const QStri class HammingDistance : public Distance { protected: - virtual double calculate(const QString& left_string, const QString& right_string); + virtual double calculate(const TQString& left_string, const TQString& right_string); int editCostReplace() { return editCost; } static const int editCost; }; @@ -113,7 +113,7 @@ protected: class LevenshteinDistance : public Distance { protected: - virtual double calculate(const QString& left_string, const QString& right_string); + virtual double calculate(const TQString& left_string, const TQString& right_string); int editCostReplace() { return editCost_replace; } static const int editCost_replace; static const int editCost_insert; @@ -122,7 +122,7 @@ protected: /** wrapper function for replacement of fstrcmp from gettext */ -inline double fstrcmp(const QString& left, const QString& right) +inline double fstrcmp(const TQString& left, const TQString& right) { return LevenshteinDistance()(left,right); } diff --git a/kbabel/common/tagextractor.cpp b/kbabel/common/tagextractor.cpp index 45b8ad9f..fded2703 100644 --- a/kbabel/common/tagextractor.cpp +++ b/kbabel/common/tagextractor.cpp @@ -40,13 +40,13 @@ using namespace KBabel; -TagExtractor::TagExtractor() : RegExpExtractor(QStringList()) +TagExtractor::TagExtractor() : RegExpExtractor(TQStringList()) { KConfig* config = KGlobal::config(); config->setGroup("Tags"); - QStringList s=config->readListEntry("TagExpressions"); + TQStringList s=config->readListEntry("TagExpressions"); if( s.empty() ) s = Defaults::Tag::tagExpressions(); RegExpExtractor::setRegExpList(s); |