diff options
Diffstat (limited to 'kexi/plugins/scripting/kexidb')
22 files changed, 262 insertions, 262 deletions
diff --git a/kexi/plugins/scripting/kexidb/kexidbconnection.cpp b/kexi/plugins/scripting/kexidb/kexidbconnection.cpp index d3b7cc76..f64a089f 100644 --- a/kexi/plugins/scripting/kexidb/kexidbconnection.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbconnection.cpp @@ -94,20 +94,20 @@ KexiDBConnection::KexiDBConnection(::KexiDB::Connection* connection, KexiDBDrive KexiDBConnection::~KexiDBConnection() { } -const QString KexiDBConnection::getClassName() const { +const TQString KexiDBConnection::getClassName() const { return "Kross::KexiDB::KexiDBConnection"; } ::KexiDB::Connection* KexiDBConnection::connection() const { if(! m_connection) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("KexiDB::Connection is NULL.")) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Connection is NULL.")) ); //if(m_connection->error()) - // throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("KexiDB::Connection error: %1").arg(m_connection->errorMsg())) ); + // throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Connection error: %1").tqarg(m_connection->errorMsg())) ); return m_connection; } bool KexiDBConnection::hadError() const { return connection()->error(); } -const QString KexiDBConnection::lastError() const { return connection()->errorMsg(); } +const TQString KexiDBConnection::lastError() const { return connection()->errorMsg(); } KexiDBConnectionData* KexiDBConnection::data() { return m_connectiondata.data(); } KexiDBDriver* KexiDBConnection::driver() { return m_driver.data(); } @@ -118,31 +118,31 @@ bool KexiDBConnection::disconnect() { return connection()->disconnect(); } bool KexiDBConnection::isReadOnly() const { return connection()->isReadOnly(); } -bool KexiDBConnection::databaseExists(const QString& dbname) { return connection()->databaseExists(dbname); } -const QString KexiDBConnection::currentDatabase() const { return connection()->currentDatabase(); } -const QStringList KexiDBConnection::databaseNames() const { return connection()->databaseNames(); } +bool KexiDBConnection::databaseExists(const TQString& dbname) { return connection()->databaseExists(dbname); } +const TQString KexiDBConnection::currentDatabase() const { return connection()->currentDatabase(); } +const TQStringList KexiDBConnection::databaseNames() const { return connection()->databaseNames(); } bool KexiDBConnection::isDatabaseUsed() const { return connection()->isDatabaseUsed(); } -bool KexiDBConnection::useDatabase(const QString& dbname) { return connection()->databaseExists(dbname) && m_connection->useDatabase(dbname); } +bool KexiDBConnection::useDatabase(const TQString& dbname) { return connection()->databaseExists(dbname) && m_connection->useDatabase(dbname); } bool KexiDBConnection::closeDatabase() { return connection()->closeDatabase(); } -const QStringList KexiDBConnection::allTableNames() const { return connection()->tableNames(true); } -const QStringList KexiDBConnection::tableNames() const { return connection()->tableNames(false); } +const TQStringList KexiDBConnection::allTableNames() const { return connection()->tableNames(true); } +const TQStringList KexiDBConnection::tableNames() const { return connection()->tableNames(false); } -const QStringList KexiDBConnection::queryNames() const { +const TQStringList KexiDBConnection::queryNames() const { bool ok = true; - QStringList queries = connection()->objectNames(::KexiDB::QueryObjectType, &ok); - if(! ok) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to determinate querynames.")) ); + TQStringList queries = connection()->objectNames(::KexiDB::QueryObjectType, &ok); + if(! ok) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to determinate querynames.")) ); return queries; } -KexiDBCursor* KexiDBConnection::executeQueryString(const QString& sqlquery) { +KexiDBCursor* KexiDBConnection::executeQueryString(const TQString& sqlquery) { // The ::KexiDB::Connection::executeQuery() method does not check if we pass a valid SELECT-statement // or e.g. a DROP TABLE operation. So, let's check for such dangerous operations right now. ::KexiDB::Parser parser( connection() ); if(! parser.parse(sqlquery)) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Failed to parse query: %1 %2").arg(parser.error().type()).arg(parser.error().error())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Failed to parse query: %1 %2").tqarg(parser.error().type()).tqarg(parser.error().error())) ); if( parser.query() == 0 || parser.operation() != ::KexiDB::Parser::OP_Select ) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("Invalid query operation \"%1\"").arg(parser.operationString()) ) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("Invalid query operation \"%1\"").tqarg(parser.operationString()) ) ); ::KexiDB::Cursor* cursor = connection()->executeQuery(sqlquery); return cursor ? new KexiDBCursor(cursor) : 0; } @@ -153,39 +153,39 @@ KexiDBCursor* KexiDBConnection::executeQuerySchema(KexiDBQuerySchema* queryschem } /*TODO -bool KexiDBConnection::insertRecordIntoFieldlist(KexiDBFieldList* fieldlist, QValueList<QVariant> values) { +bool KexiDBConnection::insertRecordIntoFieldlist(KexiDBFieldList* fieldlist, TQValueList<TQVariant> values) { return connection()->insertRecord(*fieldlist->fieldlist(), values); } -bool KexiDBConnection::insertRecordIntoTable(KexiDBTableSchema* tableschema, QValueList<QVariant> values) { +bool KexiDBConnection::insertRecordIntoTable(KexiDBTableSchema* tableschema, TQValueList<TQVariant> values) { return connection()->insertRecord(*tableschema->tableschema(), values); } */ Kross::Api::Object::Ptr KexiDBConnection::insertRecord(Kross::Api::List::Ptr args) { - QValueList<QVariant> values = Kross::Api::Variant::toList(args->item(1)); + TQValueList<TQVariant> values = Kross::Api::Variant::toList(args->item(1)); Kross::Api::Object::Ptr obj = args->item(0); if(obj->getClassName() == "Kross::KexiDB::KexiDBFieldList") return new Kross::Api::Variant( - QVariant(connection()->insertRecord( + TQVariant(connection()->insertRecord( *Kross::Api::Object::fromObject<KexiDBFieldList>(obj)->fieldlist(), values ), 0)); return new Kross::Api::Variant( - QVariant(connection()->insertRecord( + TQVariant(connection()->insertRecord( *Kross::Api::Object::fromObject<KexiDBTableSchema>(obj)->tableschema(), values ), 0)); } -bool KexiDBConnection::createDatabase(const QString& dbname) { return connection()->createDatabase(dbname); } -bool KexiDBConnection::dropDatabase(const QString& dbname) { return connection()->dropDatabase(dbname); } +bool KexiDBConnection::createDatabase(const TQString& dbname) { return connection()->createDatabase(dbname); } +bool KexiDBConnection::dropDatabase(const TQString& dbname) { return connection()->dropDatabase(dbname); } bool KexiDBConnection::createTable(KexiDBTableSchema* tableschema) { return connection()->createTable(tableschema->tableschema(), false); } -bool KexiDBConnection::dropTable(const QString& tablename) { return true == connection()->dropTable(tablename); } +bool KexiDBConnection::dropTable(const TQString& tablename) { return true == connection()->dropTable(tablename); } bool KexiDBConnection::alterTable(KexiDBTableSchema* fromschema, KexiDBTableSchema* toschema) { return true == connection()->alterTable(*fromschema->tableschema(), *toschema->tableschema()); } -bool KexiDBConnection::alterTableName(KexiDBTableSchema* tableschema, const QString& newtablename) { return connection()->alterTableName(*tableschema->tableschema(), newtablename); } +bool KexiDBConnection::alterTableName(KexiDBTableSchema* tableschema, const TQString& newtablename) { return connection()->alterTableName(*tableschema->tableschema(), newtablename); } -KexiDBTableSchema* KexiDBConnection::tableSchema(const QString& tablename) const { +KexiDBTableSchema* KexiDBConnection::tableSchema(const TQString& tablename) const { ::KexiDB::TableSchema* tableschema = connection()->tableSchema(tablename); return tableschema ? new KexiDBTableSchema(tableschema) : 0; } @@ -196,7 +196,7 @@ bool KexiDBConnection::isEmptyTable(KexiDBTableSchema* tableschema) const { return (! (success && notempty)); } -KexiDBQuerySchema* KexiDBConnection::querySchema(const QString& queryname) const { +KexiDBQuerySchema* KexiDBConnection::querySchema(const TQString& queryname) const { ::KexiDB::QuerySchema* queryschema = connection()->querySchema(queryname); return queryschema ? new KexiDBQuerySchema(queryschema) : 0; } diff --git a/kexi/plugins/scripting/kexidb/kexidbconnection.h b/kexi/plugins/scripting/kexidb/kexidbconnection.h index 7e1a7d3a..925a6e8e 100644 --- a/kexi/plugins/scripting/kexidb/kexidbconnection.h +++ b/kexi/plugins/scripting/kexidb/kexidbconnection.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBCONNECTION_H #define KROSS_KEXIDB_KEXIDBCONNECTION_H -#include <qstring.h> +#include <tqstring.h> #include <ksharedptr.h> #include <api/object.h> @@ -70,14 +70,14 @@ namespace Kross { namespace KexiDB { public: KexiDBConnection(::KexiDB::Connection* connection, KexiDBDriver* driver = 0, KexiDBConnectionData* connectiondata = 0); virtual ~KexiDBConnection(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** Return true if there was an error during last operation on the database. */ bool hadError() const; /** Return the last errormessage. */ - const QString lastError() const; + const TQString lastError() const; /** Return the KexiDBConnectionData object used to create this connection. */ KexiDBConnectionData* data(); @@ -95,31 +95,31 @@ namespace Kross { namespace KexiDB { bool isReadOnly() const; /** Return true if the as argument passed databasename exists. */ - bool databaseExists(const QString& dbname); + bool databaseExists(const TQString& dbname); /** Return the name of currently used database for this connection or empty string if there is no used database. */ - const QString currentDatabase() const; + const TQString currentDatabase() const; /** Return list of database names for opened connection. */ - const QStringList databaseNames() const; + const TQStringList databaseNames() const; /** Return true if connection is properly established. */ bool isDatabaseUsed() const; /** Opens an existing database specified by the as argument passed databasename and returns true if the database is used now. */ - bool useDatabase(const QString& dbname); + bool useDatabase(const TQString& dbname); /** Closes currently used database for this connection. */ bool closeDatabase(); /** Return names of all table schemas stored in currently used database include the internal KexiDB system table names (kexi__*) */ - const QStringList allTableNames() const; + const TQStringList allTableNames() const; /** Return names of all table schemas without the internal KexiDB system table names (kexi__*) */ - const QStringList tableNames() const; + const TQStringList tableNames() const; /** Return names of all query schemas stored in currently used database. */ - const QStringList queryNames() const; + const TQStringList queryNames() const; /** Executes query described by the as argument passed sqlstatement-string. Returns the opened cursor created for results of this query. */ - KexiDBCursor* executeQueryString(const QString& sqlquery); + KexiDBCursor* executeQueryString(const TQString& sqlquery); /** Executes query described by the as argument passed KexiDBQuerySchema object. Returns the opened cursor created for results of this query. */ KexiDBCursor* executeQuerySchema(KexiDBQuerySchema* queryschema); @@ -129,28 +129,28 @@ namespace Kross { namespace KexiDB { Kross::Api::Object::Ptr insertRecord(Kross::Api::List::Ptr); /** Creates new database with the as argument passed databasename. */ - bool createDatabase(const QString& dbname); + bool createDatabase(const TQString& dbname); /** Drops the as argument passed databasename. */ - bool dropDatabase(const QString& dbname); + bool dropDatabase(const TQString& dbname); /** Creates table defined by the as argument passed KexiTableSchema object. */ bool createTable(KexiDBTableSchema* tableschema); /** Drops table defined by the as argument passed KexiDBTableSchema object. */ - bool dropTable(const QString& tablename); + bool dropTable(const TQString& tablename); /** Alters the as first argument passed KexiDBTableSchema object using the as second argument passed KexiDBTableSchema. */ bool alterTable(KexiDBTableSchema* fromschema, KexiDBTableSchema* toschema); /** Alters the tablename of the as first argument passed KexiDBTableSchema into the as second argument passed new tablename. */ - bool alterTableName(KexiDBTableSchema* tableschema, const QString& newtablename); + bool alterTableName(KexiDBTableSchema* tableschema, const TQString& newtablename); /** Returns the KexiDBTableSchema object of the table matching to the as argument passed tablename. */ - KexiDBTableSchema* tableSchema(const QString& tablename) const; + KexiDBTableSchema* tableSchema(const TQString& tablename) const; /** Returns true if there is at least one valid record in the as argument passed tablename. */ bool isEmptyTable(KexiDBTableSchema* tableschema) const; /** Returns the KexiDBQuerySchema object of the query matching to the as argument passed queryname. */ - KexiDBQuerySchema* querySchema(const QString& queryname) const; + KexiDBQuerySchema* querySchema(const TQString& queryname) const; /** Return true if the \"auto commit\" option is on. */ bool autoCommit() const; diff --git a/kexi/plugins/scripting/kexidb/kexidbconnectiondata.cpp b/kexi/plugins/scripting/kexidb/kexidbconnectiondata.cpp index 61b81d3e..bcfe4702 100644 --- a/kexi/plugins/scripting/kexidb/kexidbconnectiondata.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbconnectiondata.cpp @@ -19,7 +19,7 @@ #include "kexidbconnectiondata.h" -#include <qvariant.h> +#include <tqvariant.h> using namespace Kross::KexiDB; @@ -70,43 +70,43 @@ KexiDBConnectionData::~KexiDBConnectionData() //delete m_data; } -const QString KexiDBConnectionData::getClassName() const +const TQString KexiDBConnectionData::getClassName() const { return "Kross::KexiDB::KexiDBConnectionData"; } -const QString KexiDBConnectionData::caption() const { return m_data->caption; } -void KexiDBConnectionData::setCaption(const QString& name) { m_data->caption = name; } +const TQString KexiDBConnectionData::caption() const { return m_data->caption; } +void KexiDBConnectionData::setCaption(const TQString& name) { m_data->caption = name; } -const QString KexiDBConnectionData::description() const { return m_data->description; } -void KexiDBConnectionData::setDescription(const QString& desc) { m_data->description = desc; } +const TQString KexiDBConnectionData::description() const { return m_data->description; } +void KexiDBConnectionData::setDescription(const TQString& desc) { m_data->description = desc; } -const QString KexiDBConnectionData::driverName() const { return m_data->driverName; } -void KexiDBConnectionData::setDriverName(const QString& driver) { m_data->driverName = driver; } +const TQString KexiDBConnectionData::driverName() const { return m_data->driverName; } +void KexiDBConnectionData::setDriverName(const TQString& driver) { m_data->driverName = driver; } bool KexiDBConnectionData::localSocketFileUsed() const { return m_data->useLocalSocketFile; } void KexiDBConnectionData::setLocalSocketFileUsed(bool used) { m_data->useLocalSocketFile = used; } -const QString KexiDBConnectionData::localSocketFileName() const { return m_data->localSocketFileName; } -void KexiDBConnectionData::setLocalSocketFileName(const QString& socketfilename) { m_data->localSocketFileName = socketfilename; } +const TQString KexiDBConnectionData::localSocketFileName() const { return m_data->localSocketFileName; } +void KexiDBConnectionData::setLocalSocketFileName(const TQString& socketfilename) { m_data->localSocketFileName = socketfilename; } -const QString KexiDBConnectionData::databaseName() const { return m_dbname; } -void KexiDBConnectionData::setDatabaseName(const QString& dbname) { m_dbname = dbname; } +const TQString KexiDBConnectionData::databaseName() const { return m_dbname; } +void KexiDBConnectionData::setDatabaseName(const TQString& dbname) { m_dbname = dbname; } -const QString KexiDBConnectionData::hostName() const { return m_data->hostName; } -void KexiDBConnectionData::setHostName(const QString& hostname) { m_data->hostName = hostname; } +const TQString KexiDBConnectionData::hostName() const { return m_data->hostName; } +void KexiDBConnectionData::setHostName(const TQString& hostname) { m_data->hostName = hostname; } int KexiDBConnectionData::port() const { return m_data->port; } void KexiDBConnectionData::setPort(int p) { m_data->port = p; } -const QString KexiDBConnectionData::password() const { return m_data->password; } -void KexiDBConnectionData::setPassword(const QString& passwd) { m_data->password = passwd; } +const TQString KexiDBConnectionData::password() const { return m_data->password; } +void KexiDBConnectionData::setPassword(const TQString& passwd) { m_data->password = passwd; } -const QString KexiDBConnectionData::userName() const { return m_data->userName; } -void KexiDBConnectionData::setUserName(const QString& username) { m_data->userName = username; } +const TQString KexiDBConnectionData::userName() const { return m_data->userName; } +void KexiDBConnectionData::setUserName(const TQString& username) { m_data->userName = username; } -const QString KexiDBConnectionData::fileName() const { return m_data->fileName(); } -void KexiDBConnectionData::setFileName(const QString& filename) { m_data->setFileName(filename); } +const TQString KexiDBConnectionData::fileName() const { return m_data->fileName(); } +void KexiDBConnectionData::setFileName(const TQString& filename) { m_data->setFileName(filename); } -const QString KexiDBConnectionData::dbPath() const { return m_data->dbPath(); } -const QString KexiDBConnectionData::dbFileName() const { return m_data->dbFileName(); } -const QString KexiDBConnectionData::serverInfoString() const { return m_data->serverInfoString(true); } +const TQString KexiDBConnectionData::dbPath() const { return m_data->dbPath(); } +const TQString KexiDBConnectionData::dbFileName() const { return m_data->dbFileName(); } +const TQString KexiDBConnectionData::serverInfoString() const { return m_data->serverInfoString(true); } diff --git a/kexi/plugins/scripting/kexidb/kexidbconnectiondata.h b/kexi/plugins/scripting/kexidb/kexidbconnectiondata.h index aaddffbd..b82c7b6e 100644 --- a/kexi/plugins/scripting/kexidb/kexidbconnectiondata.h +++ b/kexi/plugins/scripting/kexidb/kexidbconnectiondata.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBCONNECTIONDATA_H #define KROSS_KEXIDB_KEXIDBCONNECTIONDATA_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/variant.h> @@ -44,46 +44,46 @@ namespace Kross { namespace KexiDB { virtual ~KexiDBConnectionData(); operator ::KexiDB::ConnectionData& () { return *m_data; } operator ::KexiDB::ConnectionData* () { return m_data; } - virtual const QString getClassName() const; + virtual const TQString getClassName() const; ::KexiDB::ConnectionData* data() { return m_data; } private: /** Return the connection name. */ - const QString caption() const; + const TQString caption() const; /** Set the connection name. */ - void setCaption(const QString& name); + void setCaption(const TQString& name); /** Return the description. */ - const QString description() const; + const TQString description() const; /** Set the description. */ - void setDescription(const QString& desc); + void setDescription(const TQString& desc); /** Return drivername. */ - const QString driverName() const; + const TQString driverName() const; /** Set the drivername. */ - void setDriverName(const QString& driver); + void setDriverName(const TQString& driver); /** Return true if a local socket file is used else false. */ bool localSocketFileUsed() const; /** Set if the local socket file should be used. */ void setLocalSocketFileUsed(bool used); /** Return the local socket filename. */ - const QString localSocketFileName() const; + const TQString localSocketFileName() const; /** Set the local socket filename. */ - void setLocalSocketFileName(const QString& socketfilename); + void setLocalSocketFileName(const TQString& socketfilename); // For serverbased drivers /** Return the database name. */ - const QString databaseName() const; + const TQString databaseName() const; /** Set the database name. */ - void setDatabaseName(const QString& dbname); + void setDatabaseName(const TQString& dbname); /** Return the hostname. */ - const QString hostName() const; + const TQString hostName() const; /** Set the hostname. */ - void setHostName(const QString& hostname); + void setHostName(const TQString& hostname); /** Return the port number. */ int port() const; @@ -91,33 +91,33 @@ namespace Kross { namespace KexiDB { void setPort(int p); /** Return the password. */ - const QString password() const; + const TQString password() const; /** Set the password. */ - void setPassword(const QString& passwd); + void setPassword(const TQString& passwd); /** Return the username. */ - const QString userName() const; + const TQString userName() const; /** Set the username. */ - void setUserName(const QString& username); + void setUserName(const TQString& username); // For filebased drivers /** Return the filename. */ - const QString fileName() const; + const TQString fileName() const; /** Set the filename. */ - void setFileName(const QString& filename); + void setFileName(const TQString& filename); /** Return the database path. */ - const QString dbPath() const; + const TQString dbPath() const; /** Return the database filename. */ - const QString dbFileName() const; + const TQString dbFileName() const; /** Return a user-friendly string representation. */ - const QString serverInfoString() const; + const TQString serverInfoString() const; private: ::KexiDB::ConnectionData* m_data; - QString m_dbname; + TQString m_dbname; }; }} diff --git a/kexi/plugins/scripting/kexidb/kexidbcursor.cpp b/kexi/plugins/scripting/kexidb/kexidbcursor.cpp index 3bc1763d..bb9f53df 100644 --- a/kexi/plugins/scripting/kexidb/kexidbcursor.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbcursor.cpp @@ -58,14 +58,14 @@ KexiDBCursor::~KexiDBCursor() void KexiDBCursor::clearBuffers() { - QMap<Q_LLONG, Record*>::ConstIterator + TQMap<TQ_LLONG, Record*>::ConstIterator it( m_modifiedrecords.constBegin() ), end( m_modifiedrecords.constEnd() ); for( ; it != end; ++it) delete it.data(); m_modifiedrecords.clear(); } -const QString KexiDBCursor::getClassName() const +const TQString KexiDBCursor::getClassName() const { return "Kross::KexiDB::KexiDBCursor"; } @@ -83,15 +83,15 @@ bool KexiDBCursor::moveNext() { return m_cursor->moveNext(); } bool KexiDBCursor::bof() { return m_cursor->bof(); } bool KexiDBCursor::eof() { return m_cursor->eof(); } -Q_LLONG KexiDBCursor::at() { return m_cursor->at(); } +TQ_LLONG KexiDBCursor::at() { return m_cursor->at(); } uint KexiDBCursor::fieldCount() { return m_cursor->fieldCount(); } -QVariant KexiDBCursor::value(uint index) +TQVariant KexiDBCursor::value(uint index) { return m_cursor->value(index); } -bool KexiDBCursor::setValue(uint index, QVariant value) +bool KexiDBCursor::setValue(uint index, TQVariant value) { ::KexiDB::QuerySchema* query = m_cursor->query(); if(! query) { @@ -105,9 +105,9 @@ bool KexiDBCursor::setValue(uint index, QVariant value) return false; } - const Q_LLONG position = m_cursor->at(); - if(! m_modifiedrecords.contains(position)) - m_modifiedrecords.replace(position, new Record(m_cursor)); + const TQ_LLONG position = m_cursor->at(); + if(! m_modifiedrecords.tqcontains(position)) + m_modifiedrecords.tqreplace(position, new Record(m_cursor)); m_modifiedrecords[position]->buffer->insert(*column, value); return true; } @@ -124,7 +124,7 @@ bool KexiDBCursor::save() m_cursor->close(); bool ok = true; - QMap<Q_LLONG, Record*>::ConstIterator + TQMap<TQ_LLONG, Record*>::ConstIterator it( m_modifiedrecords.constBegin() ), end( m_modifiedrecords.constEnd() ); for( ; it != end; ++it) { bool b = m_cursor->updateRow(it.data()->rowdata, * it.data()->buffer, m_cursor->isBuffered()); diff --git a/kexi/plugins/scripting/kexidb/kexidbcursor.h b/kexi/plugins/scripting/kexidb/kexidbcursor.h index 6e92a38e..6ff094ae 100644 --- a/kexi/plugins/scripting/kexidb/kexidbcursor.h +++ b/kexi/plugins/scripting/kexidb/kexidbcursor.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBCURSOR_H #define KROSS_KEXIDB_KEXIDBCURSOR_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/variant.h> @@ -87,7 +87,7 @@ namespace Kross { namespace KexiDB { public: KexiDBCursor(::KexiDB::Cursor* cursor); virtual ~KexiDBCursor(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: @@ -117,14 +117,14 @@ namespace Kross { namespace KexiDB { /** Returns current internal position of the cursor's query. Records are numbered from 0; the value -1 means that the cursor does not point to a valid record. */ - Q_LLONG at(); + TQ_LLONG at(); /** Returns the number of fields available for this cursor. */ uint fieldCount(); /** Returns the value stored in the passed column number (counting from 0). */ - QVariant value(uint index); + TQVariant value(uint index); /** Set the value for the field defined with index. The new value is buffered and does not got written as long as save() is not called. */ - bool setValue(uint index, QVariant value); + bool setValue(uint index, TQVariant value); /** Save any changes done with setValue(). You should call this only once at the end of all value/setValue iterations cause the cursor is closed once @@ -148,7 +148,7 @@ namespace Kross { namespace KexiDB { delete buffer; } }; - QMap<Q_LLONG, Record*> m_modifiedrecords; + TQMap<TQ_LLONG, Record*> m_modifiedrecords; void clearBuffers(); }; diff --git a/kexi/plugins/scripting/kexidb/kexidbdriver.cpp b/kexi/plugins/scripting/kexidb/kexidbdriver.cpp index f019b237..0429c9f3 100644 --- a/kexi/plugins/scripting/kexidb/kexidbdriver.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbdriver.cpp @@ -20,8 +20,8 @@ #include "kexidbdriver.h" #include "kexidbdrivermanager.h" -#include <qvaluelist.h> -#include <qptrlist.h> +#include <tqvaluelist.h> +#include <tqptrlist.h> #include <kdebug.h> #include <kexidb/connection.h> @@ -51,7 +51,7 @@ KexiDBDriver::~KexiDBDriver() { } -const QString KexiDBDriver::getClassName() const +const TQString KexiDBDriver::getClassName() const { return "Kross::KexiDB::KexiDBDriver"; } @@ -59,12 +59,12 @@ const QString KexiDBDriver::getClassName() const bool KexiDBDriver::isValid() { return m_driver->isValid(); } int KexiDBDriver::versionMajor() { return m_driver->version().major; } int KexiDBDriver::versionMinor() { return m_driver->version().minor; } -QString KexiDBDriver::escapeString(const QString& s) { return m_driver->escapeString(s); } +TQString KexiDBDriver::escapeString(const TQString& s) { return m_driver->escapeString(s); } bool KexiDBDriver::isFileDriver() { return m_driver->isFileDriver(); } -QString KexiDBDriver::fileDBDriverMimeType() { return m_driver->fileDBDriverMimeType(); } -bool KexiDBDriver::isSystemObjectName(const QString& name) { return m_driver->isSystemObjectName(name); } -bool KexiDBDriver::isSystemDatabaseName(const QString& name) { return m_driver->isSystemDatabaseName(name); } -bool KexiDBDriver::isSystemFieldName(const QString& name) { return m_driver->isSystemFieldName(name); } -QString KexiDBDriver::valueToSQL(const QString& fieldtype, const QVariant& value) { return m_driver->valueToSQL(fieldtype, value); } +TQString KexiDBDriver::fileDBDriverMimeType() { return m_driver->fileDBDriverMimeType(); } +bool KexiDBDriver::isSystemObjectName(const TQString& name) { return m_driver->isSystemObjectName(name); } +bool KexiDBDriver::isSystemDatabaseName(const TQString& name) { return m_driver->isSystemDatabaseName(name); } +bool KexiDBDriver::isSystemFieldName(const TQString& name) { return m_driver->isSystemFieldName(name); } +TQString KexiDBDriver::valueToSQL(const TQString& fieldtype, const TQVariant& value) { return m_driver->valueToSQL(fieldtype, value); } KexiDBConnection* KexiDBDriver::createConnection(KexiDBConnectionData* data) { return new KexiDBConnection( m_driver->createConnection(*data) ); } -QPtrList< ::KexiDB::Connection > KexiDBDriver::connectionsList() { return m_driver->connectionsList(); } +TQPtrList< ::KexiDB::Connection > KexiDBDriver::connectionsList() { return m_driver->connectionsList(); } diff --git a/kexi/plugins/scripting/kexidb/kexidbdriver.h b/kexi/plugins/scripting/kexidb/kexidbdriver.h index edf7283c..786cbb1a 100644 --- a/kexi/plugins/scripting/kexidb/kexidbdriver.h +++ b/kexi/plugins/scripting/kexidb/kexidbdriver.h @@ -20,9 +20,9 @@ #ifndef KROSS_KEXIDB_KEXIDBDRIVER_H #define KROSS_KEXIDB_KEXIDBDRIVER_H -#include <qstring.h> -#include <qvaluelist.h> -//#include <qguardedptr.h> +#include <tqstring.h> +#include <tqvaluelist.h> +//#include <tqguardedptr.h> #include <api/object.h> #include <api/variant.h> @@ -67,7 +67,7 @@ namespace Kross { namespace KexiDB { public: KexiDBDriver(::KexiDB::Driver* driver); virtual ~KexiDBDriver(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: @@ -79,30 +79,30 @@ namespace Kross { namespace KexiDB { int versionMinor(); /** Driver-specific SQL string escaping. For example the " or ' char may need to be escaped for values used within SQL-statements. */ - QString escapeString(const QString& s); + TQString escapeString(const TQString& s); /** Returns true if this driver is file-based. */ bool isFileDriver(); /** Return a name of MIME type of files handled by this driver if it is a file-based database's driver otherwise returns null string. */ - QString fileDBDriverMimeType(); + TQString fileDBDriverMimeType(); /** Returns true if the passed string is a system object's name, eg. name of build-in system table that cannot be used or created by a user. */ - bool isSystemObjectName(const QString& name); + bool isSystemObjectName(const TQString& name); /** Returns true if the passed string is a system database's name, eg. name of build-in, system database that cannot be used or created by a user. */ - bool isSystemDatabaseName(const QString& name); + bool isSystemDatabaseName(const TQString& name); /** Returns true if the passed string is a system field's name, build-in system field that cannot be used or created by a user. */ - bool isSystemFieldName(const QString& name); + bool isSystemFieldName(const TQString& name); /** The as second argument passed string got escaped to be usable within a SQL-statement and those escaped string got returned by the method. The first argument defines the fieldtype to what we should escape the second argument to. */ - QString valueToSQL(const QString& fieldtype, const QVariant& value); + TQString valueToSQL(const TQString& fieldtype, const TQVariant& value); /** Create a new KexiDBConnection object and return it. */ KexiDBConnection* createConnection(KexiDBConnectionData* data); /** Return a list of KexiDBConnection objects. */ - QPtrList< ::KexiDB::Connection > connectionsList(); + TQPtrList< ::KexiDB::Connection > connectionsList(); private: ::KexiDB::Driver* m_driver; diff --git a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp index 66a0df26..c2475276 100644 --- a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.cpp @@ -25,7 +25,7 @@ #include <api/exception.h> -#include <qguardedptr.h> +#include <tqguardedptr.h> #include <kdebug.h> #include <kmimetype.h> @@ -40,7 +40,7 @@ using namespace Kross::KexiDB; KexiDBDriverManager::KexiDBDriverManager() : Kross::Api::Class<KexiDBDriverManager>("DriverManager") { - //krossdebug( QString("Kross::KexiDB::KexiDBDriverManager::KexiDBDriverManager()") ); + //krossdebug( TQString("Kross::KexiDB::KexiDBDriverManager::KexiDBDriverManager()") ); this->addFunction0< Kross::Api::Variant >("driverNames", this, &KexiDBDriverManager::driverNames); @@ -56,37 +56,37 @@ KexiDBDriverManager::KexiDBDriverManager() } KexiDBDriverManager::~KexiDBDriverManager() { - //krossdebug( QString("Kross::KexiDB::KexiDBDriverManager::~KexiDBDriverManager()") ); + //krossdebug( TQString("Kross::KexiDB::KexiDBDriverManager::~KexiDBDriverManager()") ); } -const QString KexiDBDriverManager::getClassName() const { +const TQString KexiDBDriverManager::getClassName() const { return "Kross::KexiDB::KexiDBDriverManager"; } KexiDB::DriverManager& KexiDBDriverManager::driverManager() { if(m_drivermanager.error()) - throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("KexiDB::DriverManager error: %1").arg(m_drivermanager.errorMsg())) ); + throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::DriverManager error: %1").tqarg(m_drivermanager.errorMsg())) ); return m_drivermanager; } -const QStringList KexiDBDriverManager::driverNames() { +const TQStringList KexiDBDriverManager::driverNames() { return driverManager().driverNames(); } -KexiDBDriver* KexiDBDriverManager::driver(const QString& drivername) { - QGuardedPtr< ::KexiDB::Driver > driver = driverManager().driver(drivername); // caching is done by the DriverManager +KexiDBDriver* KexiDBDriverManager::driver(const TQString& drivername) { + TQGuardedPtr< ::KexiDB::Driver > driver = driverManager().driver(drivername); // caching is done by the DriverManager if(! driver) return 0; - if(driver->error()) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(QString("KexiDB::Driver error for drivername '%1': %2").arg(drivername).arg(driver->errorMsg())) ); + if(driver->error()) throw Kross::Api::Exception::Ptr( new Kross::Api::Exception(TQString("KexiDB::Driver error for drivername '%1': %2").tqarg(drivername).tqarg(driver->errorMsg())) ); return new KexiDBDriver(driver); } -const QString KexiDBDriverManager::lookupByMime(const QString& mimetype) { +const TQString KexiDBDriverManager::lookupByMime(const TQString& mimetype) { return driverManager().lookupByMime(mimetype); } -const QString KexiDBDriverManager::mimeForFile(const QString& filename) { - QString mimename = KMimeType::findByFileContent( filename )->name(); +const TQString KexiDBDriverManager::mimeForFile(const TQString& filename) { + TQString mimename = KMimeType::findByFileContent( filename )->name(); if(mimename.isEmpty() || mimename=="application/octet-stream" || mimename=="text/plain") mimename = KMimeType::findByURL(filename)->name(); return mimename; @@ -96,18 +96,18 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionData() { return new KexiDBConnectionData( new ::KexiDB::ConnectionData() ); } -KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QString& filename) { +KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const TQString& filename) { //! @todo reuse the original code! - QString mimename = KMimeType::findByFileContent(filename)->name(); + TQString mimename = KMimeType::findByFileContent(filename)->name(); if(mimename.isEmpty() || mimename=="application/octet-stream" || mimename=="text/plain") mimename = KMimeType::findByURL(filename)->name(); if(mimename == "application/x-kexiproject-shortcut" || mimename == "application/x-kexi-connectiondata") { KConfig config(filename, true, false); - QString groupkey; - QStringList groups(config.groupList()); - QStringList::ConstIterator it, end( groups.constEnd() ); + TQString groupkey; + TQStringList groups(config.groupList()); + TQStringList::ConstIterator it, end( groups.constEnd() ); for( it = groups.constBegin(); it != end; ++it) { if((*it).lower()!="file information") { groupkey = *it; @@ -120,15 +120,15 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QStr } config.setGroup(groupkey); - //QString type( config.readEntry("type", "database").lower() ); + //TQString type( config.readEntry("type", "database").lower() ); //bool isDatabaseShortcut = (type == "database"); ::KexiDB::ConnectionData* data = new ::KexiDB::ConnectionData(); int version = config.readNumEntry("version", 2); //KexiDBShortcutFile_version - data->setFileName(QString::null); + data->setFileName(TQString()); data->caption = config.readEntry("caption"); data->description = config.readEntry("comment"); - QString dbname = config.readEntry("name"); + TQString dbname = config.readEntry("name"); data->driverName = config.readEntry("engine"); data->hostName = config.readEntry("server"); data->port = config.readNumEntry("port", 0); @@ -139,7 +139,7 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QStr data->password = config.readEntry("encryptedPassword"); uint len = data->password.length(); for (uint i=0; i<len; i++) - data->password[i] = QChar( data->password[i].unicode() - 47 - i ); + data->password[i] = TQChar( data->password[i].tqunicode() - 47 - i ); } if(data->password.isEmpty()) data->password = config.readEntry("password"); @@ -152,7 +152,7 @@ KexiDBConnectionData* KexiDBDriverManager::createConnectionDataByFile(const QStr return c; } - QString const drivername = driverManager().lookupByMime(mimename); + TQString const drivername = driverManager().lookupByMime(mimename); if(! drivername) { kdDebug() << "No driver in KexiDBDriverManager::createConnectionDataByFile filename=" << filename << " mimename=" << mimename << endl; return 0; @@ -168,7 +168,7 @@ KexiDBField* KexiDBDriverManager::field() { return new KexiDBField( new ::KexiDB::Field() ); } -KexiDBTableSchema* KexiDBDriverManager::tableSchema(const QString& tablename) { +KexiDBTableSchema* KexiDBDriverManager::tableSchema(const TQString& tablename) { return new KexiDBTableSchema( new ::KexiDB::TableSchema(tablename) ); } diff --git a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.h b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.h index b6e31108..51b20271 100644 --- a/kexi/plugins/scripting/kexidb/kexidbdrivermanager.h +++ b/kexi/plugins/scripting/kexidb/kexidbdrivermanager.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBDRIVERMANAGER_H #define KROSS_KEXIDB_KEXIDBDRIVERMANAGER_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/variant.h> @@ -61,21 +61,21 @@ namespace Kross { namespace KexiDB { public: KexiDBDriverManager(); virtual ~KexiDBDriverManager(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** Returns a list with avaible drivernames. */ - const QStringList driverNames(); + const TQStringList driverNames(); /** Return the to the defined drivername matching KexiDBDriver object. */ - KexiDBDriver* driver(const QString& drivername); + KexiDBDriver* driver(const TQString& drivername); /** Return the to the defined mimetype-string matching drivername. */ - const QString lookupByMime(const QString& mimetype); + const TQString lookupByMime(const TQString& mimetype); /** Return the matching mimetype for the defined file. */ - const QString mimeForFile(const QString& filename); + const TQString mimeForFile(const TQString& filename); /** Return a new KexiDBConnectionData object. */ KexiDBConnectionData* createConnectionData(); @@ -83,13 +83,13 @@ namespace Kross { namespace KexiDB { /** Create and return a KexiDBConnectionData object. Fill the content of the KexiDBConnectionData object with the defined file as. The file could be e.g. a *.kexi file or a *.kexis file. */ - KexiDBConnectionData* createConnectionDataByFile(const QString& filename); + KexiDBConnectionData* createConnectionDataByFile(const TQString& filename); /** Return a new KexiDBField object. */ KexiDBField* field(); /** Return a new KexiDBTableSchema object. */ - KexiDBTableSchema* tableSchema(const QString& tablename); + KexiDBTableSchema* tableSchema(const TQString& tablename); /** Return a new KexiDBQuerySchema object. */ KexiDBQuerySchema* querySchema(); diff --git a/kexi/plugins/scripting/kexidb/kexidbfield.cpp b/kexi/plugins/scripting/kexidb/kexidbfield.cpp index 949b5e1a..1f5a51de 100644 --- a/kexi/plugins/scripting/kexidb/kexidbfield.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbfield.cpp @@ -87,19 +87,19 @@ KexiDBField::~KexiDBField() { } -const QString KexiDBField::getClassName() const +const TQString KexiDBField::getClassName() const { return "Kross::KexiDB::KexiDBField"; } -const QString KexiDBField::type() { return m_field->typeString(); } -void KexiDBField::setType(const QString type) { m_field->setType( ::KexiDB::Field::typeForString(type) ); } +const TQString KexiDBField::type() { return m_field->typeString(); } +void KexiDBField::setType(const TQString type) { m_field->setType( ::KexiDB::Field::typeForString(type) ); } -const QString KexiDBField::subType() { return m_field->subType(); } -void KexiDBField::setSubType(const QString& subtype) { m_field->setSubType(subtype); } +const TQString KexiDBField::subType() { return m_field->subType(); } +void KexiDBField::setSubType(const TQString& subtype) { m_field->setSubType(subtype); } -const QString KexiDBField::variantType() { return QVariant::typeToName( m_field->variantType() ); } -const QString KexiDBField::typeGroup() { return m_field->typeGroupString(); } +const TQString KexiDBField::variantType() { return TQVariant::typeToName( m_field->variantType() ); } +const TQString KexiDBField::typeGroup() { return m_field->typeGroupString(); } bool KexiDBField::isAutoInc() { return m_field->isAutoIncrement(); } void KexiDBField::setAutoInc(bool autoinc) { m_field->setAutoIncrement(autoinc); } @@ -125,14 +125,14 @@ void KexiDBField::setIndexed(bool indexed) { m_field->setIndexed(indexed); } bool KexiDBField::isUnsigned() { return m_field->isUnsigned(); } void KexiDBField::setUnsigned(bool isunsigned) { m_field->setUnsigned(isunsigned); } -const QString KexiDBField::name() { return m_field->name(); } -void KexiDBField::setName(const QString& name) { m_field->setName(name); } +const TQString KexiDBField::name() { return m_field->name(); } +void KexiDBField::setName(const TQString& name) { m_field->setName(name); } -const QString KexiDBField::caption() { return m_field->caption(); } -void KexiDBField::setCaption(const QString& caption) { m_field->setCaption(caption); } +const TQString KexiDBField::caption() { return m_field->caption(); } +void KexiDBField::setCaption(const TQString& caption) { m_field->setCaption(caption); } -const QString KexiDBField::description() { return m_field->description(); } -void KexiDBField::setDescription(const QString& desc) { m_field->setDescription(desc); } +const TQString KexiDBField::description() { return m_field->description(); } +void KexiDBField::setDescription(const TQString& desc) { m_field->setDescription(desc); } uint KexiDBField::length() { return m_field->length(); } void KexiDBField::setLength(uint length) { m_field->setLength(length); } @@ -143,5 +143,5 @@ void KexiDBField::setPrecision(uint precision) { m_field->setPrecision(precision uint KexiDBField::width() { return m_field->width(); } void KexiDBField::setWidth(uint width) { m_field->setWidth(width); } -QVariant KexiDBField::defaultValue() { return m_field->defaultValue(); } -void KexiDBField::setDefaultValue(const QVariant& defaultvalue) { m_field->setDefaultValue(defaultvalue); } +TQVariant KexiDBField::defaultValue() { return m_field->defaultValue(); } +void KexiDBField::setDefaultValue(const TQVariant& defaultvalue) { m_field->setDefaultValue(defaultvalue); } diff --git a/kexi/plugins/scripting/kexidb/kexidbfield.h b/kexi/plugins/scripting/kexidb/kexidbfield.h index a4c2ef23..4cc85f38 100644 --- a/kexi/plugins/scripting/kexidb/kexidbfield.h +++ b/kexi/plugins/scripting/kexidb/kexidbfield.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBFIELD_H #define KROSS_KEXIDB_KEXIDBFIELD_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/list.h> @@ -39,27 +39,27 @@ namespace Kross { namespace KexiDB { public: KexiDBField(::KexiDB::Field* field); virtual ~KexiDBField(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; ::KexiDB::Field* field() { return m_field; } private: /** Returns the type string for this field, e.g. "Integer" for Integer type. */ - const QString type(); + const TQString type(); /** Sets the type string for this field, e.g. "Integer" for Integer type. */ - void setType(const QString type); + void setType(const TQString type); /** Returns the optional subtype for this field. Subtype is a string providing additional hint for field's type. E.g. for BLOB type, it can be a MIME type or - certain QVariant type name, for example: "QPixmap", "QColor" or "QFont". */ - const QString subType(); + certain TQVariant type name, for example: TQPIXMAP_OBJECT_NAME_STRING, "TQColor" or "TQFont". */ + const TQString subType(); /** Sets the optional subtype for this field. */ - void setSubType(const QString& subtype); + void setSubType(const TQString& subtype); - /** Returns the QVariant::typeName which is equivalent to the type this field has. */ - const QString variantType(); + /** Returns the TQVariant::typeName which is equivalent to the type this field has. */ + const TQString variantType(); /** Returns type group string for this field, e.g. "IntegerGroup" for IntegerGroup type. */ - const QString typeGroup(); + const TQString typeGroup(); /** Returns true if the field is autoincrement (e.g. integer/numeric). */ bool isAutoInc(); @@ -102,19 +102,19 @@ namespace Kross { namespace KexiDB { void setUnsigned(bool isunsigned); /** Returns the name of this field. */ - const QString name(); + const TQString name(); /** Sets the name of this field. */ - void setName(const QString& name); + void setName(const TQString& name); /** Returns the caption of this field. */ - const QString caption(); + const TQString caption(); /** Sets the caption of this field. */ - void setCaption(const QString& caption); + void setCaption(const TQString& caption); /** Returns the descriptive text for this field. */ - const QString description(); + const TQString description(); /** Set the description for this field. */ - void setDescription(const QString& desc); + void setDescription(const TQString& desc); /** Returns the length of text if the field type is text. */ uint length(); @@ -134,9 +134,9 @@ namespace Kross { namespace KexiDB { void setWidth(uint width); /** Returns the default value this field has. */ - QVariant defaultValue(); + TQVariant defaultValue(); /** Sets the default value this field has. */ - void setDefaultValue(const QVariant& defaultvalue); + void setDefaultValue(const TQVariant& defaultvalue); private: ::KexiDB::Field* m_field; diff --git a/kexi/plugins/scripting/kexidb/kexidbfieldlist.cpp b/kexi/plugins/scripting/kexidb/kexidbfieldlist.cpp index f36bf0b0..4e07e166 100644 --- a/kexi/plugins/scripting/kexidb/kexidbfieldlist.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbfieldlist.cpp @@ -53,7 +53,7 @@ KexiDBFieldList::~KexiDBFieldList() { } -const QString KexiDBFieldList::getClassName() const +const TQString KexiDBFieldList::getClassName() const { return "Kross::KexiDB::KexiDBFieldList"; } @@ -67,7 +67,7 @@ KexiDBField* KexiDBFieldList::field(uint index) { return field ? new KexiDBField(field) : 0; } -KexiDBField* KexiDBFieldList::fieldByName(const QString& name) { +KexiDBField* KexiDBFieldList::fieldByName(const TQString& name) { ::KexiDB::Field* field = m_fieldlist->field(name); return field ? new KexiDBField(field) : 0; } @@ -77,7 +77,7 @@ Kross::Api::List* KexiDBFieldList::fields() { } bool KexiDBFieldList::hasField(KexiDBField* field) { return m_fieldlist->hasField( field->field() ); } -const QStringList KexiDBFieldList::names() const { return m_fieldlist->names(); } +const TQStringList KexiDBFieldList::names() const { return m_fieldlist->names(); } void KexiDBFieldList::addField(KexiDBField* field) { m_fieldlist->addField( field->field() ); } void KexiDBFieldList::insertField(uint index, KexiDBField* field) { m_fieldlist->insertField(index, field->field()); } void KexiDBFieldList::removeField(KexiDBField* field) { m_fieldlist->removeField( field->field() ); } @@ -90,9 +90,9 @@ void KexiDBFieldList::setFields(KexiDBFieldList* fieldlist) { m_fieldlist->addField( it.current() ); } -KexiDBFieldList* KexiDBFieldList::subList(QValueList<QVariant> list) { - QValueList<QVariant>::ConstIterator it( list.constBegin() ), end( list.constEnd() ); - QStringList sl; +KexiDBFieldList* KexiDBFieldList::subList(TQValueList<TQVariant> list) { + TQValueList<TQVariant>::ConstIterator it( list.constBegin() ), end( list.constEnd() ); + TQStringList sl; for(; it != end; ++it) sl.append( (*it).toString() ); ::KexiDB::FieldList* fl = m_fieldlist->subList(sl); return fl ? new Kross::KexiDB::KexiDBFieldList(fl) : 0; diff --git a/kexi/plugins/scripting/kexidb/kexidbfieldlist.h b/kexi/plugins/scripting/kexidb/kexidbfieldlist.h index ee990eb3..1d7b7665 100644 --- a/kexi/plugins/scripting/kexidb/kexidbfieldlist.h +++ b/kexi/plugins/scripting/kexidb/kexidbfieldlist.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBFIELDLIST_H #define KROSS_KEXIDB_KEXIDBFIELDLIST_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/list.h> @@ -61,7 +61,7 @@ namespace Kross { namespace KexiDB { public: KexiDBFieldList(::KexiDB::FieldList* fieldlist); virtual ~KexiDBFieldList(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; ::KexiDB::FieldList* fieldlist() { return m_fieldlist; } private: @@ -71,14 +71,14 @@ namespace Kross { namespace KexiDB { /** Return the field specified by the index-number passed as an argument. */ KexiDBField* field(uint index); /** Return the field specified by the as an argument passed fieldname. */ - KexiDBField* fieldByName(const QString& name); + KexiDBField* fieldByName(const TQString& name); /** Returns a list of all fields. */ Kross::Api::List* fields(); /** Returns true if the KexiDBField object passed as an argument is in the field list. */ bool hasField(KexiDBField* field); /** Return a list of field names. */ - const QStringList names() const; + const TQStringList names() const; /** Adds the KexiDBField object passed as an argument to the field list. */ void addField(KexiDBField* field); @@ -92,7 +92,7 @@ namespace Kross { namespace KexiDB { /** Set the fieldlist to the as argument passed list of fields. */ void setFields(KexiDBFieldList* fieldlist); /** Creates and returns list that contain fields selected by name. */ - KexiDBFieldList* subList(QValueList<QVariant> list); + KexiDBFieldList* subList(TQValueList<TQVariant> list); private: ::KexiDB::FieldList* m_fieldlist; diff --git a/kexi/plugins/scripting/kexidb/kexidbmodule.cpp b/kexi/plugins/scripting/kexidb/kexidbmodule.cpp index 36f7b71f..91472a1f 100644 --- a/kexi/plugins/scripting/kexidb/kexidbmodule.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbmodule.cpp @@ -58,12 +58,12 @@ KexiDBModule::~KexiDBModule() //kdDebug() << "Kross::KexiDB::KexiDBModule Dtor" << endl; } -const QString KexiDBModule::getClassName() const +const TQString KexiDBModule::getClassName() const { return "Kross::KexiDB::KexiDBModule"; } -Kross::Api::Object::Ptr KexiDBModule::get(const QString& name, void* p) +Kross::Api::Object::Ptr KexiDBModule::get(const TQString& name, void* p) { if(name == "KexiDBConnection") { ::KexiDB::Connection* connection = (::KexiDB::Connection*)p; diff --git a/kexi/plugins/scripting/kexidb/kexidbmodule.h b/kexi/plugins/scripting/kexidb/kexidbmodule.h index b91b6047..eb7c9c22 100644 --- a/kexi/plugins/scripting/kexidb/kexidbmodule.h +++ b/kexi/plugins/scripting/kexidb/kexidbmodule.h @@ -20,8 +20,8 @@ #ifndef KROSS_KEXIDB_KEXIDBMODULE_H #define KROSS_KEXIDB_KEXIDBMODULE_H -#include <qstring.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqvariant.h> #include <api/module.h> @@ -45,7 +45,7 @@ namespace KexiDB { public: KexiDBModule(Kross::Api::Manager* manager); virtual ~KexiDBModule(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; /** * \internal @@ -59,7 +59,7 @@ namespace KexiDB { * the module and the name what this pointer is. * \return a \a Kross::Api::Object or NULL. */ - virtual Kross::Api::Object::Ptr get(const QString& name, void* p = 0); + virtual Kross::Api::Object::Ptr get(const TQString& name, void* p = 0); }; diff --git a/kexi/plugins/scripting/kexidb/kexidbparser.cpp b/kexi/plugins/scripting/kexidb/kexidbparser.cpp index b022570d..63aecda9 100644 --- a/kexi/plugins/scripting/kexidb/kexidbparser.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbparser.cpp @@ -50,14 +50,14 @@ KexiDBParser::~KexiDBParser() { } -const QString KexiDBParser::getClassName() const +const TQString KexiDBParser::getClassName() const { return "Kross::KexiDB::KexiDBParser"; } -bool KexiDBParser::parse(const QString& sql) { return m_parser->parse(sql); } +bool KexiDBParser::parse(const TQString& sql) { return m_parser->parse(sql); } void KexiDBParser::clear() { m_parser->clear(); } -const QString KexiDBParser::operation() { return m_parser->operationString(); } +const TQString KexiDBParser::operation() { return m_parser->operationString(); } KexiDBTableSchema* KexiDBParser::table() { ::KexiDB::TableSchema* t = m_parser->table(); @@ -70,8 +70,8 @@ KexiDBQuerySchema* KexiDBParser::query() { } KexiDBConnection* KexiDBParser::connection() { return m_connection; } -const QString KexiDBParser::statement() { return m_parser->statement(); } +const TQString KexiDBParser::statement() { return m_parser->statement(); } -const QString KexiDBParser::errorType() { return m_parser->error().type(); } -const QString KexiDBParser::errorMsg() { return m_parser->error().error(); } +const TQString KexiDBParser::errorType() { return m_parser->error().type(); } +const TQString KexiDBParser::errorMsg() { return m_parser->error().error(); } int KexiDBParser::errorAt() { return m_parser->error().at(); } diff --git a/kexi/plugins/scripting/kexidb/kexidbparser.h b/kexi/plugins/scripting/kexidb/kexidbparser.h index 09ac22da..e09df068 100644 --- a/kexi/plugins/scripting/kexidb/kexidbparser.h +++ b/kexi/plugins/scripting/kexidb/kexidbparser.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBPARSER_H #define KROSS_KEXIDB_KEXIDBPARSER_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/list.h> @@ -57,16 +57,16 @@ namespace Kross { namespace KexiDB { public: KexiDBParser(KexiDBConnection* connection, ::KexiDB::Parser* parser); virtual ~KexiDBParser(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /** Clears previous results and runs the parser on the SQL statement passed as an argument. */ - bool parse(const QString& sql); + bool parse(const TQString& sql); /** Clears parsing results. */ void clear(); /** Returns the resulting operation. */ - const QString operation(); + const TQString operation(); /** Returns the KexiDBTableSchema object on a CREATE TABLE operation. */ KexiDBTableSchema* table(); @@ -75,12 +75,12 @@ namespace Kross { namespace KexiDB { /** Returns the KexiDBConnection object pointing to the used database connection. */ KexiDBConnection* connection(); /** Returns the SQL query statement. */ - const QString statement(); + const TQString statement(); /** Returns the type string of the last error. */ - const QString errorType(); + const TQString errorType(); /** Returns the message of the last error. */ - const QString errorMsg(); + const TQString errorMsg(); /** Returns the position where the last error occurred. */ int errorAt(); 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); } diff --git a/kexi/plugins/scripting/kexidb/kexidbschema.h b/kexi/plugins/scripting/kexidb/kexidbschema.h index 61b6bc88..c2243035 100644 --- a/kexi/plugins/scripting/kexidb/kexidbschema.h +++ b/kexi/plugins/scripting/kexidb/kexidbschema.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBSCHEMA_H #define KROSS_KEXIDB_KEXIDBSCHEMA_H -#include <qstring.h> +#include <tqstring.h> #include <api/object.h> #include <api/class.h> @@ -59,25 +59,25 @@ namespace Kross { namespace KexiDB { class KexiDBSchema : public Kross::Api::Class<T> { public: - KexiDBSchema(const QString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist); + KexiDBSchema(const TQString& name, ::KexiDB::SchemaData* schema, ::KexiDB::FieldList* fieldlist); virtual ~KexiDBSchema(); private: /** Returns the name of the schema. */ - const QString name() const; + const TQString name() const; /** Set the name of the schema. */ - void setName(const QString& name); + void setName(const TQString& name); /** Returns the caption of the schema. */ - const QString caption() const; + const TQString caption() const; /** Set the caption of the schema. */ - void setCaption(const QString& caption); + void setCaption(const TQString& caption); /** Returns a description of the schema. */ - const QString description() const; + const TQString description() const; /** Set a description of the schema. */ - void setDescription(const QString& description); + void setDescription(const TQString& description); /** Returns the KexiDBFieldList object this schema has. */ KexiDBFieldList* fieldlist() const; @@ -95,7 +95,7 @@ namespace Kross { namespace KexiDB { public: KexiDBTableSchema(::KexiDB::TableSchema* tableschema); virtual ~KexiDBTableSchema(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; ::KexiDB::TableSchema* tableschema(); private: @@ -114,17 +114,17 @@ namespace Kross { namespace KexiDB { public: KexiDBQuerySchema(::KexiDB::QuerySchema* queryschema); virtual ~KexiDBQuerySchema(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; ::KexiDB::QuerySchema* queryschema(); private: /** Returns the SQL-statement of this query schema. */ - const QString statement() const; + const TQString statement() const; /** Set the SQL-statement of this query schema. */ - void setStatement(const QString& statement); + void setStatement(const TQString& statement); /** Set the where-expression. */ - bool setWhereExpression(const QString& whereexpression); + bool setWhereExpression(const TQString& whereexpression); }; diff --git a/kexi/plugins/scripting/kexidb/kexidbtransaction.cpp b/kexi/plugins/scripting/kexidb/kexidbtransaction.cpp index d4cdff24..73f4bf28 100644 --- a/kexi/plugins/scripting/kexidb/kexidbtransaction.cpp +++ b/kexi/plugins/scripting/kexidb/kexidbtransaction.cpp @@ -38,7 +38,7 @@ KexiDBTransaction::~KexiDBTransaction() { } -const QString KexiDBTransaction::getClassName() const +const TQString KexiDBTransaction::getClassName() const { return "Kross::KexiDB::KexiDBTransaction"; } diff --git a/kexi/plugins/scripting/kexidb/kexidbtransaction.h b/kexi/plugins/scripting/kexidb/kexidbtransaction.h index 6a6b5785..d02e44d6 100644 --- a/kexi/plugins/scripting/kexidb/kexidbtransaction.h +++ b/kexi/plugins/scripting/kexidb/kexidbtransaction.h @@ -20,7 +20,7 @@ #ifndef KROSS_KEXIDB_KEXIDBTRANSACTION_H #define KROSS_KEXIDB_KEXIDBTRANSACTION_H -#include <qstring.h> +#include <tqstring.h> #include <api/class.h> @@ -41,7 +41,7 @@ namespace Kross { namespace KexiDB { public: KexiDBTransaction(::KexiDB::Transaction& transaction); virtual ~KexiDBTransaction(); - virtual const QString getClassName() const; + virtual const TQString getClassName() const; ::KexiDB::Transaction& transaction(); private: |