diff options
Diffstat (limited to 'kexi/plugins/scripting/kexidb/kexidbschema.cpp')
-rw-r--r-- | kexi/plugins/scripting/kexidb/kexidbschema.cpp | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/kexi/plugins/scripting/kexidb/kexidbschema.cpp b/kexi/plugins/scripting/kexidb/kexidbschema.cpp index e07917f3..aebcbd7e 100644 --- a/kexi/plugins/scripting/kexidb/kexidbschema.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbschema.cpp @@ -21,7 +21,7 @@ #include "kexidbschema.h" #include "kexidbfieldlist.h" -#include <qregexp.h> +#include <tqregexp.h> #include <kdebug.h> #include <api/variant.h> @@ -33,7 +33,7 @@ using namespace Kross::KexiDB; */ template<class T> -KexiDBSchema<T>::KexiDBSchema(const QString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist) +KexiDBSchema<T>::KexiDBSchema(const TQString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist) : Kross::Api::Class<T>(name) , m_schema(schema) , m_fieldlist(fieldlist) @@ -55,32 +55,32 @@ KexiDBSchema<T>::~KexiDBSchema<T>() { } template<class T> -const QString KexiDBSchema<T>::name() const { +const TQString KexiDBSchema<T>::name() const { return m_schema->name(); } template<class T> -void KexiDBSchema<T>::setName(const QString& name) { +void KexiDBSchema<T>::setName(const TQString& name) { m_schema->setName(name); } template<class T> -const QString KexiDBSchema<T>::caption() const { +const TQString KexiDBSchema<T>::caption() const { return m_schema->caption(); } template<class T> -void KexiDBSchema<T>::setCaption(const QString& caption) { +void KexiDBSchema<T>::setCaption(const TQString& caption) { m_schema->setCaption(caption); } template<class T> -const QString KexiDBSchema<T>::description() const { +const TQString KexiDBSchema<T>::description() const { return m_schema->description(); } template<class T> -void KexiDBSchema<T>::setDescription(const QString& description) { +void KexiDBSchema<T>::setDescription(const TQString& description) { m_schema->setDescription(description); } @@ -102,7 +102,7 @@ KexiDBTableSchema::KexiDBTableSchema(::KexiDB::TableSchema* tableschema) KexiDBTableSchema::~KexiDBTableSchema() { } -const QString KexiDBTableSchema::getClassName() const { +const TQString KexiDBTableSchema::getClassName() const { return "Kross::KexiDB::KexiDBTableSchema"; } @@ -129,7 +129,7 @@ KexiDBQuerySchema::KexiDBQuerySchema(::KexiDB::QuerySchema* queryschema) KexiDBQuerySchema::~KexiDBQuerySchema() { } -const QString KexiDBQuerySchema::getClassName() const { +const TQString KexiDBQuerySchema::getClassName() const { return "Kross::KexiDB::KexiDBQuerySchema"; } @@ -137,53 +137,53 @@ const QString KexiDBQuerySchema::getClassName() const { return static_cast< ::KexiDB::QuerySchema* >(m_schema); } -const QString KexiDBQuerySchema::statement() const { +const TQString KexiDBQuerySchema::statement() const { return static_cast< ::KexiDB::QuerySchema* >(m_schema)->statement(); } -void KexiDBQuerySchema::setStatement(const QString& statement) { +void KexiDBQuerySchema::setStatement(const TQString& statement) { static_cast< ::KexiDB::QuerySchema* >(m_schema)->setStatement(statement); } -bool KexiDBQuerySchema::setWhereExpression(const QString& whereexpression) { +bool KexiDBQuerySchema::setWhereExpression(const TQString& whereexpression) { ::KexiDB::BaseExpr* oldexpr = static_cast< ::KexiDB::QuerySchema* >(m_schema)->whereExpression(); ///@todo use ::KexiDB::Parser for such kind of parser-functionality. - QString s = whereexpression; + TQString s = whereexpression; try { - QRegExp re("[\"',]{1,1}"); + TQRegExp re("[\"',]{1,1}"); while(true) { - s.remove(QRegExp("^[\\s,]+")); - int pos = s.find('='); + s.remove(TQRegExp("^[\\s,]+")); + int pos = s.tqfind('='); if(pos < 0) break; - QString key = s.left(pos).stripWhiteSpace(); + TQString key = s.left(pos).stripWhiteSpace(); s = s.mid(pos + 1).stripWhiteSpace(); - QString value; - int sp = s.find(re); + TQString value; + int sp = s.tqfind(re); if(sp >= 0) { if(re.cap(0) == ",") { value = s.left(sp).stripWhiteSpace(); s = s.mid(sp+1).stripWhiteSpace(); } else { - int ep = s.find(re.cap(0),sp+1); + int ep = s.tqfind(re.cap(0),sp+1); value = s.mid(sp+1,ep-1); s = s.mid(ep + 1); } } else { value = s; - s = QString::null; + s = TQString(); } ::KexiDB::Field* field = static_cast< ::KexiDB::QuerySchema* >(m_schema)->field(key); if(! field) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Invalid WHERE-expression: Field \"%1\" does not exists in tableschema \"%2\".").arg(key).arg(m_schema->name())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid WHERE-expression: Field \"%1\" does not exists in tableschema \"%2\".").tqarg(key).tqarg(m_schema->name())) ); - QVariant v(value); + TQVariant v(value); if(! v.cast(field->variantType())) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Invalid WHERE-expression: The for Field \"%1\" defined value is of type \"%2\" rather then the expected type \"%3\"").arg(key).arg(v.typeName()).arg(field->variantType())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid WHERE-expression: The for Field \"%1\" defined value is of type \"%2\" rather then the expected type \"%3\"").tqarg(key).tqarg(v.typeName()).tqarg(field->variantType())) ); static_cast< ::KexiDB::QuerySchema* >(m_schema)->addToWhereExpression(field,v); } |