From 4ae0c208b66e0f7954e194384464fe2d0a2c56dd Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:51:49 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1157652 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kbabel/datatools/regexp/main.cc | 42 ++++++++++++++++++++--------------------- kbabel/datatools/regexp/main.h | 22 ++++++++++----------- 2 files changed, 32 insertions(+), 32 deletions(-) (limited to 'kbabel/datatools/regexp') 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 -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include #include @@ -49,16 +49,16 @@ K_EXPORT_COMPONENT_FACTORY( kbabel_regexptool, KGenericFactory ( "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 -#include +#include 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 ExpressionList; +typedef TQValueList 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 -- cgit v1.2.1