diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-12 01:36:19 +0000 |
commit | 99a2774ca6f1cab334de5d43fe36fc44ae889a4c (patch) | |
tree | eff34cf0762227f6baf2a93e8fef48d4bed2651c /kbabel/datatools/arguments | |
parent | 1c104292188541106338d4940b0f04beeb4301a0 (diff) | |
download | tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.tar.gz tdesdk-99a2774ca6f1cab334de5d43fe36fc44ae889a4c.zip |
TQt4 convert kdesdk
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1236185 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbabel/datatools/arguments')
-rw-r--r-- | kbabel/datatools/arguments/main.cc | 40 | ||||
-rw-r--r-- | kbabel/datatools/arguments/main.h | 9 |
2 files changed, 25 insertions, 24 deletions
diff --git a/kbabel/datatools/arguments/main.cc b/kbabel/datatools/arguments/main.cc index e80c7c35..4b533061 100644 --- a/kbabel/datatools/arguments/main.cc +++ b/kbabel/datatools/arguments/main.cc @@ -19,11 +19,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -51,8 +51,8 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_argstool, KGenericFactory<ArgumentTool> ( "kb using namespace KBabel; -ArgumentTool::ArgumentTool( TQObject* parent, const char* name, const TQStringList & ) - : KDataTool( parent, name ), _cache_origin( 0 ) +ArgumentTool::ArgumentTool( TQObject* tqparent, const char* name, const TQStringList & ) + : KDataTool( tqparent, name ), _cache_origin( 0 ) { i18n( "what check found errors","arguments"); } @@ -110,46 +110,46 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat if( line.startsWith("_n:" )) { // truncate text after first \n to get args only once - line = line.mid(0,line.find("\\n")); + line = line.mid(0,line.tqfind("\\n")); } } - line.replace(_context, ""); - line.replace(TQRegExp("\\n"),""); + line.tqreplace(_context, ""); + line.tqreplace(TQRegExp("\\n"),""); line.simplifyWhiteSpace(); // flag, for GNU only we can allow reordering bool non_gnu = (item->pluralForm() == KDESpecific); - int index=line.find(TQRegExp("%.")); + int index=line.tqfind(TQRegExp("%.")); while(index>=0) { - int endIndex=line.find(TQRegExp("[^\\d]"),index+1); + int endIndex=line.tqfind(TQRegExp("[^\\d]"),index+1); if(endIndex<0) { endIndex=line.length(); } - else if( formatChars.contains(line[endIndex]) ) + else if( formatChars.tqcontains(line[endIndex]) ) { endIndex++; } if(endIndex - index > 1 ) { TQString arg = line.mid(index,endIndex-index); - if( arg.contains( TQRegExp("\\d") ) ) { + if( arg.tqcontains( TQRegExp("\\d") ) ) { non_gnu = true; } argList.append(arg); } - index=line.find(TQRegExp("%."),endIndex); + index=line.tqfind(TQRegExp("%."),endIndex); } if( item->pluralForm()==KDESpecific) { // FIXME: this is KDE specific - if( _checkPlurals && line.startsWith("_n:" ) && !argList.contains("%n") ) + if( _checkPlurals && line.startsWith("_n:" ) && !argList.tqcontains("%n") ) { argList.append("%n"); } @@ -180,7 +180,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat line=(*i); - line.replace(TQRegExp("\\n"),""); + line.tqreplace(TQRegExp("\\n"),""); TQRegExp argdesc( "%((["+formatChars+"])" @@ -196,7 +196,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat if( index == -1 ) break; // do not add a redundant argument, if it is non GNU - if( !non_gnu || !foundArgs.contains( argdesc.cap(0) ) ) + if( !non_gnu || !foundArgs.tqcontains( argdesc.cap(0) ) ) foundArgs.append( argdesc.cap( 0 ) ); } while( true ); @@ -205,7 +205,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat if( non_gnu ) { for ( TQStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it ) { - if( argList.find( *it ) == argList.end() ) { + if( argList.tqfind( *it ) == argList.end() ) { hasError = true; break; } else { @@ -224,10 +224,10 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat for ( TQStringList::Iterator it = foundArgs.begin(); it != foundArgs.end(); ++it , ++oit) { if( *it == *oit ) { // argument is the same, mark as used - *oit = TQString::null; + *oit = TQString(); } else { // try to strip replacement - int index = (*it).find( '$' ); + int index = (*it).tqfind( '$' ); if( index == -1 ) { // there is no replacement, this is wrong hasError = true; @@ -239,7 +239,7 @@ bool ArgumentTool::run( const TQString& command, void* data, const TQString& dat TQStringList::Iterator a = argList.at( place.toInt()-1 ); if( a != argList.end() && (*a) == arg ) { - (*a) = TQString::null; + (*a) = TQString(); } else { diff --git a/kbabel/datatools/arguments/main.h b/kbabel/datatools/arguments/main.h index ea7e4e23..1831ea33 100644 --- a/kbabel/datatools/arguments/main.h +++ b/kbabel/datatools/arguments/main.h @@ -19,11 +19,11 @@ In addition, as a special exception, the copyright holders give permission to link the code of this program with any edition of - the Qt library by Trolltech AS, Norway (or with modified versions - of Qt that use the same license as Qt), and distribute linked + the TQt library by Trolltech AS, Norway (or with modified versions + of TQt that use the same license as TQt), and distribute linked combinations including the two. You must obey the GNU General Public License in all respects for all of the code used other than - Qt. If you modify this file, you may extend this exception to + TQt. If you modify this file, you may extend this exception to your version of the file, but you are not obligated to do so. If you do not wish to do so, delete this exception statement from your version. @@ -42,9 +42,10 @@ class ArgumentTool : public KDataTool { Q_OBJECT + TQ_OBJECT public: - ArgumentTool( TQObject* parent, const char* name, const TQStringList & ); + ArgumentTool( TQObject* tqparent, 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; |