diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:51:49 +0000 |
commit | 4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch) | |
tree | b0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/datatools/arguments | |
parent | 1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff) | |
download | tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.tar.gz tdesdk-4ae0c208b66e0f7954e194384464fe2d0a2c56dd.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/datatools/arguments')
-rw-r--r-- | kbabel/datatools/arguments/main.cc | 54 | ||||
-rw-r--r-- | kbabel/datatools/arguments/main.h | 8 |
2 files changed, 31 insertions, 31 deletions
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; }; |