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/regexp/main.cc | |
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/regexp/main.cc')
-rw-r--r-- | kbabel/datatools/regexp/main.cc | 42 |
1 files changed, 21 insertions, 21 deletions
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" |