diff options
Diffstat (limited to 'kbabel/datatools')
24 files changed, 191 insertions, 191 deletions
diff --git a/kbabel/datatools/accelerators/main.cc b/kbabel/datatools/accelerators/main.cc index 2bf6ec90..632eb7b5 100644 --- a/kbabel/datatools/accelerators/main.cc +++ b/kbabel/datatools/accelerators/main.cc @@ -51,14 +51,14 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_accelstool, KGenericFactory<AcceleratorTool> using namespace KBabel; -AcceleratorTool::AcceleratorTool( QObject* parent, const char* name, const QStringList & ) +AcceleratorTool::AcceleratorTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ) { // bogus translation just for allowing the translation i18n("what check found errors","accelerator"); } -bool AcceleratorTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool AcceleratorTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -96,26 +96,26 @@ bool AcceleratorTool::run( const QString& command, void* data, const QString& da if(!item->isUntranslated()) { // FIXME: this should care about plural forms in msgid - QString lineid=item->msgid().first(); + TQString lineid=item->msgid().first(); lineid.replace( _context, ""); - lineid.replace(QRegExp("\\n"),""); + lineid.replace(TQRegExp("\\n"),""); lineid.simplifyWhiteSpace(); - QString regStr(_marker); + TQString regStr(_marker); regStr+="[^\\s]"; - QRegExp reg(regStr); + TQRegExp reg(regStr); - QStringList str = item->msgstr(true); - for( QStringList::Iterator form = str.begin() ; form != str.end(); form++ ) + TQStringList str = item->msgstr(true); + for( TQStringList::Iterator form = str.begin() ; form != str.end(); form++ ) { - QString linestr=(*form); + TQString linestr=(*form); linestr.simplifyWhiteSpace(); int n = lineid.contains(reg); if( _marker == '&' ) - n = n - lineid.contains(QRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))")); + n = n - lineid.contains(TQRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))")); int m = linestr.contains(reg); if( _marker == '&' ) - m = m - linestr.contains(QRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))")); + m = m - linestr.contains(TQRegExp("(&[a-z,A-Z,\\-,0-9,#]*;)|(&&(?!&+))")); hasError = hasError || ( n<=1 && m != n); } } diff --git a/kbabel/datatools/accelerators/main.h b/kbabel/datatools/accelerators/main.h index 4eba780e..ee9ae3a8 100644 --- a/kbabel/datatools/accelerators/main.h +++ b/kbabel/datatools/accelerators/main.h @@ -37,19 +37,19 @@ #include <kdatatool.h> -#include <qregexp.h> +#include <tqregexp.h> class AcceleratorTool : public KDataTool { Q_OBJECT public: - AcceleratorTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + AcceleratorTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: - QRegExp _context; - QChar _marker; + TQRegExp _context; + TQChar _marker; KBabel::Project::Ptr _cache_origin; }; diff --git a/kbabel/datatools/arguments/main.cc b/kbabel/datatools/arguments/main.cc index fd3daf3c..e80c7c35 100644 --- a/kbabel/datatools/arguments/main.cc +++ b/kbabel/datatools/arguments/main.cc @@ -51,13 +51,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_argstool, KGenericFactory<ArgumentTool> ( "kb using namespace KBabel; -ArgumentTool::ArgumentTool( QObject* parent, const char* name, const QStringList & ) +ArgumentTool::ArgumentTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ) { i18n( "what check found errors","arguments"); } -bool ArgumentTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool ArgumentTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -96,13 +96,13 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat if(!item->isUntranslated()) { - QString formatChars="dioxXucsfeEgGp%"; + TQString formatChars="dioxXucsfeEgGp%"; if( _checkPlurals ) formatChars+="n"; // FIXME: this should care about plural forms in msgid - QString line=item->msgid().first(); - QStringList argList; + TQString line=item->msgid().first(); + TQStringList argList; // if( isPluralForm() ) { @@ -114,17 +114,17 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat } } line.replace(_context, ""); - line.replace(QRegExp("\\n"),""); + line.replace(TQRegExp("\\n"),""); line.simplifyWhiteSpace(); // flag, for GNU only we can allow reordering bool non_gnu = (item->pluralForm() == KDESpecific); - int index=line.find(QRegExp("%.")); + int index=line.find(TQRegExp("%.")); while(index>=0) { - int endIndex=line.find(QRegExp("[^\\d]"),index+1); + int endIndex=line.find(TQRegExp("[^\\d]"),index+1); if(endIndex<0) { endIndex=line.length(); @@ -135,15 +135,15 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat } if(endIndex - index > 1 ) { - QString arg = line.mid(index,endIndex-index); - if( arg.contains( QRegExp("\\d") ) ) { + TQString arg = line.mid(index,endIndex-index); + if( arg.contains( TQRegExp("\\d") ) ) { non_gnu = true; } argList.append(arg); } - index=line.find(QRegExp("%."),endIndex); + index=line.find(TQRegExp("%."),endIndex); } if( item->pluralForm()==KDESpecific) @@ -157,22 +157,22 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat // generate for each plural form to be checked separately line=item->msgstr().first(); - QStringList lines; + TQStringList lines; // FIXME; this is KDE specific if( item->pluralForm() == KDESpecific ) { - lines = QStringList::split("\\n",line); + lines = TQStringList::split("\\n",line); } else { lines.append(line); } - QStringList argCache = argList; - QStringList foundArgs; + TQStringList argCache = argList; + TQStringList foundArgs; - for(QStringList::Iterator i = lines.begin() ; i!=lines.end() ; i++) + for(TQStringList::Iterator i = lines.begin() ; i!=lines.end() ; i++) { // initialize for the next plural form foundArgs.clear(); @@ -180,9 +180,9 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat line=(*i); - line.replace(QRegExp("\\n"),""); + line.replace(TQRegExp("\\n"),""); - QRegExp argdesc( + TQRegExp argdesc( "%((["+formatChars+"])" +"|(\\d)+" +"|(\\d)+\\$(["+formatChars+"])" @@ -204,7 +204,7 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat argList = argCache; if( non_gnu ) { - for ( QStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it ) { + for ( TQStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it ) { if( argList.find( *it ) == argList.end() ) { hasError = true; break; @@ -220,11 +220,11 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat else { // handle GNU with replacements - QStringList::Iterator oit = argList.begin(); - for ( QStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it , ++oit) { + TQStringList::Iterator oit = argList.begin(); + for ( TQStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it , ++oit) { if( *it == *oit ) { // argument is the same, mark as used - *oit = QString::null; + *oit = TQString::null; } else { // try to strip replacement int index = (*it).find( '$' ); @@ -233,13 +233,13 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat hasError = true; break; } - QString place = (*it).mid( 1, index-1 ); - QString arg = (*it).right( index ); + TQString place = (*it).mid( 1, index-1 ); + TQString arg = (*it).right( index ); arg[0] = '%'; - QStringList::Iterator a = argList.at( place.toInt()-1 ); + TQStringList::Iterator a = argList.at( place.toInt()-1 ); if( a != argList.end() && (*a) == arg ) { - (*a) = QString::null; + (*a) = TQString::null; } else { @@ -249,7 +249,7 @@ bool ArgumentTool::run( const QString& command, void* data, const QString& datat } } - for ( QStringList::Iterator it = argList.begin(); it != argList.end(); ++it) { + for ( TQStringList::Iterator it = argList.begin(); it != argList.end(); ++it) { if( ! (*it).isNull () ) { // argument is the same, mark as used hasError = true; diff --git a/kbabel/datatools/arguments/main.h b/kbabel/datatools/arguments/main.h index 1f258ca9..ea7e4e23 100644 --- a/kbabel/datatools/arguments/main.h +++ b/kbabel/datatools/arguments/main.h @@ -37,18 +37,18 @@ #include <kdatatool.h> -#include <qregexp.h> +#include <tqregexp.h> class ArgumentTool : public KDataTool { Q_OBJECT public: - ArgumentTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + ArgumentTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: KBabel::Project::Ptr _cache_origin; - QRegExp _context; + TQRegExp _context; bool _checkPlurals; }; diff --git a/kbabel/datatools/context/main.cc b/kbabel/datatools/context/main.cc index 7715cedd..066ef430 100644 --- a/kbabel/datatools/context/main.cc +++ b/kbabel/datatools/context/main.cc @@ -52,13 +52,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_contexttool, KGenericFactory<ContextTool> ( " using namespace KBabel; -ContextTool::ContextTool( QObject* parent, const char* name, const QStringList & ) +ContextTool::ContextTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ) { i18n("what check found errors","context info"); } -bool ContextTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool ContextTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { diff --git a/kbabel/datatools/context/main.h b/kbabel/datatools/context/main.h index 80388d17..8dc24e9f 100644 --- a/kbabel/datatools/context/main.h +++ b/kbabel/datatools/context/main.h @@ -42,11 +42,11 @@ class ContextTool : public KDataTool Q_OBJECT public: - ContextTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + ContextTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: KBabel::Project::Ptr _cache_origin; - QRegExp _context; + TQRegExp _context; }; #endif diff --git a/kbabel/datatools/equations/main.cc b/kbabel/datatools/equations/main.cc index 14a03cd6..64d19adf 100644 --- a/kbabel/datatools/equations/main.cc +++ b/kbabel/datatools/equations/main.cc @@ -52,13 +52,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_equationstool, KGenericFactory<EquationsTool> using namespace KBabel; -EquationsTool::EquationsTool( QObject* parent, const char* name, const QStringList & ) +EquationsTool::EquationsTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _equation("^[a-zA-Z0-9]+=.+") { i18n("what check found errors","equations"); } -bool EquationsTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool EquationsTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -90,7 +90,7 @@ bool EquationsTool::run( const QString& command, void* data, const QString& data && item->msgid().first().contains(_equation)) { int index = item->msgid().first().find('='); - QString left = item->msgid().first().left(index); + TQString left = item->msgid().first().left(index); index = item->msgstr().first().find('='); if(left != item->msgstr().first().left(index)) hasError = true; diff --git a/kbabel/datatools/equations/main.h b/kbabel/datatools/equations/main.h index 15337a1b..72fae529 100644 --- a/kbabel/datatools/equations/main.h +++ b/kbabel/datatools/equations/main.h @@ -33,7 +33,7 @@ #ifndef __main_h__ #define __main_h__ -#include <qregexp.h> +#include <tqregexp.h> #include <kdatatool.h> class EquationsTool : public KDataTool @@ -41,10 +41,10 @@ class EquationsTool : public KDataTool Q_OBJECT public: - EquationsTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + EquationsTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: - QRegExp _equation; + TQRegExp _equation; }; #endif diff --git a/kbabel/datatools/length/main.cc b/kbabel/datatools/length/main.cc index 6e62c626..5b2bc411 100644 --- a/kbabel/datatools/length/main.cc +++ b/kbabel/datatools/length/main.cc @@ -55,13 +55,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_lengthtool, KGenericFactory<LengthTool> ( "kb using namespace KBabel; -LengthTool::LengthTool( QObject* parent, const char* name, const QStringList & ) +LengthTool::LengthTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ) { i18n("which check found errors","translation has inconsistent length"); } -bool LengthTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool LengthTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) @@ -89,7 +89,7 @@ bool LengthTool::run( const QString& command, void* data, const QString& datatyp CatalogItem* item = (CatalogItem*)(data); bool hasError = false; - QStringList str, id; + TQStringList str, id; if(!item->isUntranslated()) { @@ -102,9 +102,9 @@ bool LengthTool::run( const QString& command, void* data, const QString& datatyp //Ensure KDE plural forms are in a StringList if( item->pluralForm() == KDESpecific ) { - str = QStringList::split( "\\n", item->msgstr().first(), true ); - id = QStringList::split( "\\n", - item->msgid().first().replace( QRegExp(_plurals), ""), true ); + str = TQStringList::split( "\\n", item->msgstr().first(), true ); + id = TQStringList::split( "\\n", + item->msgid().first().replace( TQRegExp(_plurals), ""), true ); } else { str = item->msgstr(); id = item->msgid(); @@ -116,11 +116,11 @@ bool LengthTool::run( const QString& command, void* data, const QString& datatyp //FIXME: replace 10% check with configurable setting or a statistical //based expected length relationship int idlen, strlen; - for( QStringList::Iterator i = id.begin() ; i != id.end() ; i++ ) { - QString iditem = (*i); - idlen = iditem.replace( QRegExp(_context),"").length(); - for( QStringList::Iterator j = str.begin() ; j != str.end() ; j++ ) { - QString stritem = (*j); + for( TQStringList::Iterator i = id.begin() ; i != id.end() ; i++ ) { + TQString iditem = (*i); + idlen = iditem.replace( TQRegExp(_context),"").length(); + for( TQStringList::Iterator j = str.begin() ; j != str.end() ; j++ ) { + TQString stritem = (*j); strlen = stritem.length(); hasError = hasError || (strlen < (0.1 * idlen)) || (strlen > (10 * idlen)); diff --git a/kbabel/datatools/length/main.h b/kbabel/datatools/length/main.h index 7e84cf55..6a4ec06f 100644 --- a/kbabel/datatools/length/main.h +++ b/kbabel/datatools/length/main.h @@ -43,12 +43,12 @@ class LengthTool : public KDataTool Q_OBJECT public: - LengthTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + LengthTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: KBabel::Project::Ptr _cache_origin; - QRegExp _context; - QRegExp _plurals; + TQRegExp _context; + TQRegExp _plurals; }; #endif diff --git a/kbabel/datatools/not-translated/main.cc b/kbabel/datatools/not-translated/main.cc index 0714caf3..22e23c84 100644 --- a/kbabel/datatools/not-translated/main.cc +++ b/kbabel/datatools/not-translated/main.cc @@ -54,13 +54,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_nottranslatedtool, KGenericFactory<NotTransla using namespace KBabel; -NotTranslatedTool::NotTranslatedTool( QObject* parent, const char* name, const QStringList & ) +NotTranslatedTool::NotTranslatedTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ) , _cache_origin( 0 ) { i18n("which check found errors","English text in translation"); } -bool NotTranslatedTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool NotTranslatedTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) @@ -97,19 +97,19 @@ bool NotTranslatedTool::run( const QString& command, void* data, const QString& } //FIXME Expand this to do substring matching of non-translation - QStringList id, str; + TQStringList id, str; if( item->pluralForm() == KDESpecific ) { - str = QStringList::split( "\\n", item->msgstr().first(), true ); - id = QStringList::split( "\\n", - item->msgid().first().replace( QRegExp(_plurals), ""), true ); + str = TQStringList::split( "\\n", item->msgstr().first(), true ); + id = TQStringList::split( "\\n", + item->msgid().first().replace( TQRegExp(_plurals), ""), true ); } else { str = item->msgstr(); id = item->msgid(); } - for( QStringList::Iterator i = id.begin() ; i != id.end() ; i++ ) { - QString id_str = (*i).replace( QRegExp(_context), ""); - for( QStringList::Iterator j = str.begin() ; j != str.end() ; j++ ) { - QString str_str = (*j); + for( TQStringList::Iterator i = id.begin() ; i != id.end() ; i++ ) { + TQString id_str = (*i).replace( TQRegExp(_context), ""); + for( TQStringList::Iterator j = str.begin() ; j != str.end() ; j++ ) { + TQString str_str = (*j); hasError = hasError || ( id_str == str_str ); } } diff --git a/kbabel/datatools/not-translated/main.h b/kbabel/datatools/not-translated/main.h index 3b1176e8..c1aeabd8 100644 --- a/kbabel/datatools/not-translated/main.h +++ b/kbabel/datatools/not-translated/main.h @@ -43,13 +43,13 @@ class NotTranslatedTool : public KDataTool Q_OBJECT public: - NotTranslatedTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + NotTranslatedTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: KBabel::Project::Ptr _cache_origin; - QRegExp _context; - QRegExp _plurals; + TQRegExp _context; + TQRegExp _plurals; }; #endif diff --git a/kbabel/datatools/pluralforms/main.cc b/kbabel/datatools/pluralforms/main.cc index 4d275e60..87dfef71 100644 --- a/kbabel/datatools/pluralforms/main.cc +++ b/kbabel/datatools/pluralforms/main.cc @@ -53,13 +53,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_pluraltool, KGenericFactory<PluralsTool> ( "k using namespace KBabel; -PluralsTool::PluralsTool( QObject* parent, const char* name, const QStringList & ) +PluralsTool::PluralsTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ), _neededForms(-1) { i18n("what check found errors", "plural forms"); } -bool PluralsTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool PluralsTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -106,7 +106,7 @@ bool PluralsTool::run( const QString& command, void* data, const QString& dataty { hasError = true; } - else if( item->msgstr().first().contains(QString("\\n"))+1 != _neededForms ) + else if( item->msgstr().first().contains(TQString("\\n"))+1 != _neededForms ) { hasError = true; } diff --git a/kbabel/datatools/pluralforms/main.h b/kbabel/datatools/pluralforms/main.h index f2101975..420824d2 100644 --- a/kbabel/datatools/pluralforms/main.h +++ b/kbabel/datatools/pluralforms/main.h @@ -42,11 +42,11 @@ class PluralsTool : public KDataTool Q_OBJECT public: - PluralsTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + PluralsTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: KBabel::Project::Ptr _cache_origin; - QRegExp _plurals; + TQRegExp _plurals; int _neededForms; }; diff --git a/kbabel/datatools/punctuation/main.cc b/kbabel/datatools/punctuation/main.cc index 433d9711..8806b536 100644 --- a/kbabel/datatools/punctuation/main.cc +++ b/kbabel/datatools/punctuation/main.cc @@ -51,14 +51,14 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_punctuationtool, KGenericFactory<PunctuationT using namespace KBabel; -PunctuationTool::PunctuationTool( QObject* parent, const char* name, const QStringList & ) +PunctuationTool::PunctuationTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ) { // bogus translation just for allowing the translation i18n("what check found errors","punctuation"); } -bool PunctuationTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool PunctuationTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -88,23 +88,23 @@ bool PunctuationTool::run( const QString& command, void* data, const QString& da if(!item->isUntranslated()) { - QString lineid=item->msgid().first(); + TQString lineid=item->msgid().first(); // lookup punctuation in original text - QRegExp punc("[\\.!\\?:]+$"); + TQRegExp punc("[\\.!\\?:]+$"); int i = lineid.find(punc); - QString t(""); + TQString t(""); if( i != -1 ) t = lineid.right(lineid.length()-i); if( item->pluralForm() != NoPluralForm ) { // check, that both plural forms contain the same punctuation - QString pl = *(item->msgid().at(1)); + TQString pl = *(item->msgid().at(1)); int j = pl.find(punc); - QString tp(""); + TQString tp(""); if( j != -1 ) tp = pl.right(pl.length()-j); if( tp != t ) @@ -113,14 +113,14 @@ bool PunctuationTool::run( const QString& command, void* data, const QString& da } } - QStringList forms = item->msgstr(true); + TQStringList forms = item->msgstr(true); if( item->pluralForm() == KDESpecific ) { - forms = QStringList::split("\\n",*item->msgstr(true).at(0)); + forms = TQStringList::split("\\n",*item->msgstr(true).at(0)); } - for( QStringList::Iterator form = forms.begin() ; form != forms.end(); form++ ) + for( TQStringList::Iterator form = forms.begin() ; form != forms.end(); form++ ) { - QString linestr=(*form); + TQString linestr=(*form); int j = linestr.find(punc); diff --git a/kbabel/datatools/punctuation/main.h b/kbabel/datatools/punctuation/main.h index 63a36d62..eb30293f 100644 --- a/kbabel/datatools/punctuation/main.h +++ b/kbabel/datatools/punctuation/main.h @@ -40,8 +40,8 @@ class PunctuationTool : public KDataTool Q_OBJECT public: - PunctuationTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + PunctuationTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); }; #endif diff --git a/kbabel/datatools/regexp/main.cc b/kbabel/datatools/regexp/main.cc index a101d5c9..eca0be81 100644 --- a/kbabel/datatools/regexp/main.cc +++ b/kbabel/datatools/regexp/main.cc @@ -27,11 +27,11 @@ #include "main.h" #include <math.h> -#include <qdir.h> -#include <qfile.h> -#include <qdom.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqdom.h> +#include <tqstringlist.h> +#include <tqregexp.h> #include <kconfig.h> #include <kdebug.h> #include <kgenericfactory.h> @@ -49,16 +49,16 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_regexptool, KGenericFactory<RegExpTool> ( "kb using namespace KBabel; -RegExpTool::RegExpTool( QObject* parent, const char* name, const QStringList & ) +RegExpTool::RegExpTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ) { i18n("which check found errors","translation has inconsistent length"); loadExpressions(); if ( ! _error.isNull() ) - KMessageBox::error( (QWidget*)parent, i18n( "Error loading data (%1)" ).arg( _error ) ); + KMessageBox::error( (TQWidget*)parent, i18n( "Error loading data (%1)" ).arg( _error ) ); } -bool RegExpTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool RegExpTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -86,8 +86,8 @@ bool RegExpTool::run( const QString& command, void* data, const QString& datatyp if(!item->isUntranslated()) { ExpressionList::Iterator it( _list.begin() ); ExpressionList::Iterator end( _list.end() ); - QStringList msgs = item->msgstr(); - QStringList results; + TQStringList msgs = item->msgstr(); + TQStringList results; for ( ; it != end; ++it ) { results.clear(); results = msgs.grep( (*it).regExp() ); @@ -110,8 +110,8 @@ bool RegExpTool::run( const QString& command, void* data, const QString& datatyp void RegExpTool::loadExpressions() { // TODO: Change file path - QFile file( QDir::homeDirPath() + "/.kde/share/apps/kbabel/regexplist.xml" ); - QDomDocument doc; + TQFile file( TQDir::homeDirPath() + "/.kde/share/apps/kbabel/regexplist.xml" ); + TQDomDocument doc; if ( ! file.open( IO_ReadOnly ) ) { kdDebug() << "File not found" << endl; @@ -125,10 +125,10 @@ void RegExpTool::loadExpressions() } file.close(); - QDomElement docElem = doc.documentElement(); - QDomNode n = docElem.firstChild(); + TQDomElement docElem = doc.documentElement(); + TQDomNode n = docElem.firstChild(); while( !n.isNull() ) { - QDomElement e = n.toElement(); + TQDomElement e = n.toElement(); if( !e.isNull() ) elementToExpression( e ); if ( ! _error.isNull() ) @@ -137,10 +137,10 @@ void RegExpTool::loadExpressions() } } -void RegExpTool::elementToExpression( const QDomElement& e ) +void RegExpTool::elementToExpression( const TQDomElement& e ) { - QString name; - QString exp; + TQString name; + TQString exp; bool cs = false; //Expressions are case insensitive by default if ( e.tagName().compare( "item" ) != 0 ) { @@ -148,13 +148,13 @@ void RegExpTool::elementToExpression( const QDomElement& e ) return; } - QDomNode n = e.firstChild(); + TQDomNode n = e.firstChild(); if ( n.isNull() ) { _error = i18n( "First child of 'item' is not a node" ); return; } - QDomElement el = n.toElement(); + TQDomElement el = n.toElement(); if ( el.isNull() || el.tagName().compare( "name" ) != 0 ) { _error = i18n( "Expected tag 'name'" ); return; @@ -175,7 +175,7 @@ void RegExpTool::elementToExpression( const QDomElement& e ) cs = true; kdDebug(KBABEL) << "RegExpTool: Adding expression: " << name << endl; - _list.append( Expression( name, QRegExp( exp, cs ) ) ); + _list.append( Expression( name, TQRegExp( exp, cs ) ) ); } #include "main.moc" diff --git a/kbabel/datatools/regexp/main.h b/kbabel/datatools/regexp/main.h index 4ae8953b..c81f96a0 100644 --- a/kbabel/datatools/regexp/main.h +++ b/kbabel/datatools/regexp/main.h @@ -25,7 +25,7 @@ #define __main_h__ #include <kdatatool.h> -#include <qvaluelist.h> +#include <tqvaluelist.h> class QDomElement; @@ -33,41 +33,41 @@ class Expression { public: Expression() {}; - Expression( const QString& name, const QRegExp& regExp ) + Expression( const TQString& name, const TQRegExp& regExp ) { _name = name; _regExp = regExp; } - const QString& name() const + const TQString& name() const { return _name; } - const QRegExp& regExp() const + const TQRegExp& regExp() const { return _regExp; } private: - QString _name; - QRegExp _regExp; + TQString _name; + TQRegExp _regExp; }; -typedef QValueList<Expression> ExpressionList; +typedef TQValueList<Expression> ExpressionList; class RegExpTool : public KDataTool { Q_OBJECT public: - RegExpTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + RegExpTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: void loadExpressions(); - void elementToExpression( const QDomElement& e ); + void elementToExpression( const TQDomElement& e ); ExpressionList _list; - QString _error; + TQString _error; }; #endif diff --git a/kbabel/datatools/setfuzzy/main.cc b/kbabel/datatools/setfuzzy/main.cc index 373560ec..54bbcb57 100644 --- a/kbabel/datatools/setfuzzy/main.cc +++ b/kbabel/datatools/setfuzzy/main.cc @@ -49,12 +49,12 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_setfuzzytool, KGenericFactory<SetFuzzyTool> ( using namespace KBabel; -SetFuzzyTool::SetFuzzyTool( QObject* parent, const char* name, const QStringList & ) +SetFuzzyTool::SetFuzzyTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ) { } -bool SetFuzzyTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool SetFuzzyTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "allfuzzy" ) { diff --git a/kbabel/datatools/setfuzzy/main.h b/kbabel/datatools/setfuzzy/main.h index 5c86bf15..45e0bc38 100644 --- a/kbabel/datatools/setfuzzy/main.h +++ b/kbabel/datatools/setfuzzy/main.h @@ -40,8 +40,8 @@ class SetFuzzyTool : public KDataTool Q_OBJECT public: - SetFuzzyTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + SetFuzzyTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); }; #endif diff --git a/kbabel/datatools/whitespace/main.cc b/kbabel/datatools/whitespace/main.cc index 882815a5..7bfa50b2 100644 --- a/kbabel/datatools/whitespace/main.cc +++ b/kbabel/datatools/whitespace/main.cc @@ -54,13 +54,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_whitespacetool, KGenericFactory<WhitespaceToo using namespace KBabel; -WhitespaceTool::WhitespaceTool( QObject* parent, const char* name, const QStringList & ) +WhitespaceTool::WhitespaceTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ), _equation("^[a-zA-Z0-9]+=") { i18n("which check found errors","whitespace only translation"); } -bool WhitespaceTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool WhitespaceTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) @@ -89,8 +89,8 @@ bool WhitespaceTool::run( const QString& command, void* data, const QString& dat CatalogItem* item = (CatalogItem*)(data); bool hasIdError = false; bool hasStrError = false; - QRegExp _whitespace("^\\s+$"); - QStringList str, id; + TQRegExp _whitespace("^\\s+$"); + TQStringList str, id; if(!item->isUntranslated()) { if( _cache_origin != item->project() ) @@ -102,28 +102,28 @@ bool WhitespaceTool::run( const QString& command, void* data, const QString& dat //Ensure KDE plural forms are in a StringList //FIXME Eliminate context information and this could become a generic message splitter if( item->pluralForm() == KDESpecific ) { - str = QStringList::split( "\\n", item->msgstr().first(), true ); - id = QStringList::split( "\\n", - item->msgid().first().replace( QRegExp(_plurals), ""), true ); + str = TQStringList::split( "\\n", item->msgstr().first(), true ); + id = TQStringList::split( "\\n", + item->msgid().first().replace( TQRegExp(_plurals), ""), true ); } else { str = item->msgstr(); id = item->msgid(); } //Strip equations - id.first().replace( QRegExp(_equation), ""); - str.first().replace( QRegExp(_equation), ""); + id.first().replace( TQRegExp(_equation), ""); + str.first().replace( TQRegExp(_equation), ""); //Ignore Messages with blank msgid components - for( QStringList::Iterator it = id.begin() ; it != id.end() ; it++ ) { - QString resultstring = (*it); + for( TQStringList::Iterator it = id.begin() ; it != id.end() ; it++ ) { + TQString resultstring = (*it); hasIdError = hasIdError || resultstring.contains(_whitespace); } if( hasIdError ) return true; - //Check each QString in the List is not whitespace - for( QStringList::Iterator it = str.begin() ; it != str.end() ; it++ ) { - QString resultstring = (*it); + //Check each TQString in the List is not whitespace + for( TQStringList::Iterator it = str.begin() ; it != str.end() ; it++ ) { + TQString resultstring = (*it); hasStrError = hasStrError || resultstring.contains(_whitespace); } diff --git a/kbabel/datatools/whitespace/main.h b/kbabel/datatools/whitespace/main.h index 2a234457..c8cd373a 100644 --- a/kbabel/datatools/whitespace/main.h +++ b/kbabel/datatools/whitespace/main.h @@ -36,7 +36,7 @@ #include "kbproject.h" -#include <qregexp.h> +#include <tqregexp.h> #include <kdatatool.h> class WhitespaceTool : public KDataTool @@ -44,12 +44,12 @@ class WhitespaceTool : public KDataTool Q_OBJECT public: - WhitespaceTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + WhitespaceTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: KBabel::Project::Ptr _cache_origin; - QRegExp _plurals; - QRegExp _equation; + TQRegExp _plurals; + TQRegExp _equation; }; #endif diff --git a/kbabel/datatools/xml/main.cc b/kbabel/datatools/xml/main.cc index cae88b4c..3bcf66da 100644 --- a/kbabel/datatools/xml/main.cc +++ b/kbabel/datatools/xml/main.cc @@ -35,7 +35,7 @@ #include "catalogsettings.h" #include "main.h" -#include <qdom.h> +#include <tqdom.h> #include <kconfig.h> #include <kdebug.h> @@ -54,13 +54,13 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_xmltool, KGenericFactory<XMLTool> ( "kbabelda using namespace KBabel; -XMLTool::XMLTool( QObject* parent, const char* name, const QStringList & ) +XMLTool::XMLTool( TQObject* parent, const char* name, const TQStringList & ) : KDataTool( parent, name ), _cache_origin( 0 ) { i18n( "what check found errors", "XML tags" ); } -bool XMLTool::run( const QString& command, void* data, const QString& datatype, const QString& mimetype ) +bool XMLTool::run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype ) { if ( command != "validate" ) { @@ -93,9 +93,9 @@ bool XMLTool::run( const QString& command, void* data, const QString& datatype, } uint correctnessLevel = 0; - QString msgid = item->msgid().first(); + TQString msgid = item->msgid().first(); msgid.replace( "\\\"", "\"" ); // Change '\"' to '"' - msgid.replace( QRegExp( "&(?![a-zA-Z0-9]+;)" ), "&" ); + msgid.replace( TQRegExp( "&(?![a-zA-Z0-9]+;)" ), "&" ); msgid.replace( _context, "" ); msgid.replace("\n",""); // delete newlines @@ -130,12 +130,12 @@ bool XMLTool::run( const QString& command, void* data, const QString& datatype, if(!item->isUntranslated()) { - QStringList str = item->msgstr(true); - for( QStringList::Iterator form = str.begin() ; form != str.end() ; form++ ) + TQStringList str = item->msgstr(true); + for( TQStringList::Iterator form = str.begin() ; form != str.end() ; form++ ) { - QString text=(*form); + TQString text=(*form); text.replace( "\\\"", "\"" ); // Change '\"' to '"' - text.replace( QRegExp( "&(?![a-zA-Z0-9]+;)" ), "&" ); + text.replace( TQRegExp( "&(?![a-zA-Z0-9]+;)" ), "&" ); // isNonCaseWithoutCommonCompliant can fail // even though higher level checks works @@ -171,34 +171,34 @@ bool XMLTool::run( const QString& command, void* data, const QString& datatype, return FALSE; } -bool XMLTool::isFullyCompliant( const QString& text) +bool XMLTool::isFullyCompliant( const TQString& text) { - QDomDocument doc; + TQDomDocument doc; return doc.setContent("<para>" + text + "</para>" ); } -bool XMLTool::isNonCaseCompliant( const QString& text) +bool XMLTool::isNonCaseCompliant( const TQString& text) { - QDomDocument doc; - QString test = text.lower(); + TQDomDocument doc; + TQString test = text.lower(); return doc.setContent("<para>" + test + "</para>" ); } -bool XMLTool::isNonCaseWithoutCommonCompliant( const QString& text) +bool XMLTool::isNonCaseWithoutCommonCompliant( const TQString& text) { - QDomDocument doc; - QString test = text.lower(); - QRegExp rx( "(<br>)|(<hr>)|(<p>)||(<\\w+@(\\w+.)*\\w+>)" ); + TQDomDocument doc; + TQString test = text.lower(); + TQRegExp rx( "(<br>)|(<hr>)|(<p>)||(<\\w+@(\\w+.)*\\w+>)" ); test.replace( rx, "" ); - QString a; + TQString a; do { a = test; - test.replace( QRegExp("<[^_:A-Za-z/]"), "" ); + test.replace( TQRegExp("<[^_:A-Za-z/]"), "" ); } while( a!=test); - test.replace( QRegExp("<$"), "" ); + test.replace( TQRegExp("<$"), "" ); return doc.setContent("<para>" + test + "</para>" ); } diff --git a/kbabel/datatools/xml/main.h b/kbabel/datatools/xml/main.h index 357a4f0d..68c06cdb 100644 --- a/kbabel/datatools/xml/main.h +++ b/kbabel/datatools/xml/main.h @@ -35,7 +35,7 @@ #include "kbproject.h" -#include <qmap.h> +#include <tqmap.h> #include <kdatatool.h> class XMLTool : public KDataTool @@ -43,17 +43,17 @@ class XMLTool : public KDataTool Q_OBJECT public: - XMLTool( QObject* parent, const char* name, const QStringList & ); - virtual bool run( const QString& command, void* data, const QString& datatype, const QString& mimetype); + XMLTool( TQObject* parent, const char* name, const TQStringList & ); + virtual bool run( const TQString& command, void* data, const TQString& datatype, const TQString& mimetype); private: - bool isFullyCompliant( const QString& text); - bool isNonCaseCompliant( const QString& text); - bool isNonCaseWithoutCommonCompliant( const QString& text); + bool isFullyCompliant( const TQString& text); + bool isNonCaseCompliant( const TQString& text); + bool isNonCaseWithoutCommonCompliant( const TQString& text); - QMap<QString,int> _levelCache; + TQMap<TQString,int> _levelCache; KBabel::Project::Ptr _cache_origin; - QRegExp _context; + TQRegExp _context; }; #endif |