summaryrefslogtreecommitdiffstats
path: root/kbabel/datatools/regexp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-07-31 19:51:49 +0000
commit4ae0c208b66e0f7954e194384464fe2d0a2c56dd (patch)
treeb0a7cd1c184f0003c0292eb416ed27f674f9cc43 /kbabel/datatools/regexp
parent1964ea0fb4ab57493ca2ebb709c8d3b5395fd653 (diff)
downloadtdesdk-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')
-rw-r--r--kbabel/datatools/regexp/main.cc42
-rw-r--r--kbabel/datatools/regexp/main.h22
2 files changed, 32 insertions, 32 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"
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