diff options
Diffstat (limited to 'kexi/plugins/scripting')
39 files changed, 448 insertions, 445 deletions
diff --git a/kexi/plugins/scripting/kexiapp/kexiappmainwindow.cpp b/kexi/plugins/scripting/kexiapp/kexiappmainwindow.cpp index 4d82bc5d..5ee81a43 100644 --- a/kexi/plugins/scripting/kexiapp/kexiappmainwindow.cpp +++ b/kexi/plugins/scripting/kexiapp/kexiappmainwindow.cpp @@ -67,7 +67,7 @@ KexiAppMainWindow::~KexiAppMainWindow() delete d; } -const QString KexiAppMainWindow::getClassName() const +const TQString KexiAppMainWindow::getClassName() const { return "Kross::KexiApp::KexiAppMainWindow"; } @@ -88,7 +88,7 @@ Kross::Api::Object::Ptr KexiAppMainWindow::getConnection() return module->get("KexiDBConnection", connection); } -Kross::Api::List* KexiAppMainWindow::getPartItems(const QString& mimetype) +Kross::Api::List* KexiAppMainWindow::getPartItems(const TQString& mimetype) { if(mimetype.isNull()) return 0; // just to be sure... KexiPart::ItemDict* items = d->project()->itemsForMimeType( mimetype.latin1() ); diff --git a/kexi/plugins/scripting/kexiapp/kexiappmainwindow.h b/kexi/plugins/scripting/kexiapp/kexiappmainwindow.h index fd02c193..7eecd213 100644 --- a/kexi/plugins/scripting/kexiapp/kexiappmainwindow.h +++ b/kexi/plugins/scripting/kexiapp/kexiappmainwindow.h @@ -20,8 +20,8 @@ #ifndef KROSS_KEXIAPP_KEXIAPPMAINWINDOW_H #define KROSS_KEXIAPP_KEXIAPPMAINWINDOW_H -#include <qstring.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqvariant.h> #include <api/object.h> #include <api/variant.h> @@ -58,7 +58,7 @@ namespace Kross { namespace KexiApp { virtual ~KexiAppMainWindow(); /// \see Kross::Api::Object::getClassName - virtual const QString getClassName() const; + virtual const TQString getClassName() const; /** \return true if Kexi is connected with a project else false is returned. */ @@ -74,7 +74,7 @@ namespace Kross { namespace KexiApp { /** \return a list of \a KexiAppPartItem objects for the defined \p mimetype string. */ - Kross::Api::List* getPartItems(const QString& mimetype); + Kross::Api::List* getPartItems(const TQString& mimetype); /** Try to open the defined \a KexiAppPartItem and \return true on success else false. */ diff --git a/kexi/plugins/scripting/kexiapp/kexiappmodule.cpp b/kexi/plugins/scripting/kexiapp/kexiappmodule.cpp index cb664496..9a1c73d7 100644 --- a/kexi/plugins/scripting/kexiapp/kexiappmodule.cpp +++ b/kexi/plugins/scripting/kexiapp/kexiappmodule.cpp @@ -90,7 +90,7 @@ KexiAppModule::~KexiAppModule() } -const QString KexiAppModule::getClassName() const +const TQString KexiAppModule::getClassName() const { return "Kross::KexiApp::KexiAppModule"; } diff --git a/kexi/plugins/scripting/kexiapp/kexiappmodule.h b/kexi/plugins/scripting/kexiapp/kexiappmodule.h index 08ed71f0..2b87cca5 100644 --- a/kexi/plugins/scripting/kexiapp/kexiappmodule.h +++ b/kexi/plugins/scripting/kexiapp/kexiappmodule.h @@ -20,8 +20,8 @@ #ifndef KROSS_KEXIAPP_KEXIAPPMODULE_H #define KROSS_KEXIAPP_KEXIAPPMODULE_H -#include <qstring.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqvariant.h> #include <api/module.h> @@ -63,7 +63,7 @@ namespace KexiApp { virtual ~KexiAppModule(); /// \see Kross::Api::Object::getClassName - virtual const QString getClassName() const; + virtual const TQString getClassName() const; private: /// Private d-pointer class. diff --git a/kexi/plugins/scripting/kexiapp/kexiapppart.h b/kexi/plugins/scripting/kexiapp/kexiapppart.h index 5f55d6bf..bf399641 100644 --- a/kexi/plugins/scripting/kexiapp/kexiapppart.h +++ b/kexi/plugins/scripting/kexiapp/kexiapppart.h @@ -20,8 +20,8 @@ #ifndef KROSS_KEXIAPP_KEXIAPPPART_H #define KROSS_KEXIAPP_KEXIAPPPART_H -#include <qstring.h> -#include <qvariant.h> +#include <tqstring.h> +#include <tqvariant.h> #include <api/object.h> #include <api/variant.h> @@ -43,7 +43,7 @@ namespace Kross { namespace KexiApp { public: KexiAppPartItem(KexiPart::Item*); virtual ~KexiAppPartItem() {} - virtual const QString getClassName() const { return "Kross::KexiApp::KexiAppPartItem"; } + virtual const TQString getClassName() const { return "Kross::KexiApp::KexiAppPartItem"; } KexiPart::Item* item() { return m_item; } private: diff --git a/kexi/plugins/scripting/kexidb.doxyfile b/kexi/plugins/scripting/kexidb.doxyfile index e40a378e..3e21f7f1 100644 --- a/kexi/plugins/scripting/kexidb.doxyfile +++ b/kexi/plugins/scripting/kexidb.doxyfile @@ -16,7 +16,7 @@ ABBREVIATE_BRIEF = "The $name class" \ is \ provides \ specifies \ - contains \ + tqcontains \ represents \ a \ an \ @@ -111,7 +111,7 @@ RECURSIVE = YES EXCLUDE = EXCLUDE_SYMLINKS = YES -EXCLUDE_PATTERNS = config.h *.moc.cpp +EXCLUDE_PATTERNS = config.h *.tqmoc.cpp EXAMPLE_PATH = EXAMPLE_PATTERNS = * 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: diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp index ff2f93d0..0c95cb0e 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp +++ b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp @@ -28,12 +28,12 @@ #include <kross/main/scriptaction.h> #include <kross/api/interpreter.h> -#include <qlayout.h> -#include <qsplitter.h> -#include <qtimer.h> -#include <qdatetime.h> -#include <qdom.h> -#include <qstylesheet.h> +#include <tqlayout.h> +#include <tqsplitter.h> +#include <tqtimer.h> +#include <tqdatetime.h> +#include <tqdom.h> +#include <tqstylesheet.h> #include <ktextbrowser.h> #include <kdebug.h> @@ -64,17 +64,17 @@ class KexiScriptDesignViewPrivate KTextBrowser* statusbrowser; }; -KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, QWidget *parent, Kross::Api::ScriptAction* scriptaction) - : KexiViewBase(mainWin, parent, "KexiScriptDesignView") +KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, TQWidget *tqparent, Kross::Api::ScriptAction* scriptaction) + : KexiViewBase(mainWin, tqparent, "KexiScriptDesignView") , d( new KexiScriptDesignViewPrivate() ) { d->scriptaction = scriptaction; d->updatesProperties = false; - QSplitter* splitter = new QSplitter(this); - splitter->setOrientation(Vertical); - QHBoxLayout* layout = new QHBoxLayout(this); - layout->addWidget(splitter); + TQSplitter* splitter = new TQSplitter(this); + splitter->setOrientation(Qt::Vertical); + TQHBoxLayout* tqlayout = new TQHBoxLayout(this); + tqlayout->addWidget(splitter); d->editor = new KexiScriptEditor(mainWin, splitter, "ScriptEditor"); splitter->setFocusProxy(d->editor); @@ -83,23 +83,23 @@ KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, QWidget *par d->statusbrowser = new KTextBrowser(splitter, "ScriptStatusBrowser"); d->statusbrowser->setReadOnly(true); - d->statusbrowser->setTextFormat(QTextBrowser::RichText); - //d->browser->setWordWrap(QTextEdit::WidgetWidth); + d->statusbrowser->setTextFormat(TQTextBrowser::RichText); + //d->browser->setWordWrap(TQTextEdit::WidgetWidth); d->statusbrowser->installEventFilter(this); - splitter->setResizeMode(d->statusbrowser, QSplitter::KeepSize); + splitter->setResizeMode(d->statusbrowser, TQSplitter::KeepSize); - plugSharedAction( "data_execute", this, SLOT(execute()) ); + plugSharedAction( "data_execute", TQT_TQOBJECT(this), TQT_SLOT(execute()) ); if(KexiEditor::isAdvancedEditor()) // the configeditor is only in advanced mode avaiable. - plugSharedAction( "script_config_editor", d->editor, SLOT(slotConfigureEditor()) ); + plugSharedAction( "script_config_editor", TQT_TQOBJECT(d->editor), TQT_SLOT(slotConfigureEditor()) ); loadData(); - d->properties = new KoProperty::Set(this, "KexiScripting"); - connect(d->properties, SIGNAL( propertyChanged(KoProperty::Set&, KoProperty::Property&) ), - this, SLOT( slotPropertyChanged(KoProperty::Set&, KoProperty::Property&) )); + d->properties = new KoProperty::Set(TQT_TQOBJECT(this), "KexiScripting"); + connect(d->properties, TQT_SIGNAL( propertyChanged(KoProperty::Set&, KoProperty::Property&) ), + this, TQT_SLOT( slotPropertyChanged(KoProperty::Set&, KoProperty::Property&) )); // To schedule the initialize fixes a crasher in Kate. - QTimer::singleShot(50, this, SLOT( initialize() )); + TQTimer::singleShot(50, this, TQT_SLOT( initialize() )); } KexiScriptDesignView::~KexiScriptDesignView() @@ -127,14 +127,14 @@ void KexiScriptDesignView::updateProperties() Kross::Api::Manager* manager = Kross::Api::Manager::scriptManager(); - QString interpretername = d->scriptaction->getInterpreterName(); + TQString interpretername = d->scriptaction->getInterpreterName(); Kross::Api::InterpreterInfo* info = interpretername.isEmpty() ? 0 : manager->getInterpreterInfo(interpretername); { // if interpreter isn't defined or invalid, try to fallback. - QStringList list; + TQStringList list; list << "python" << "ruby"; - QStringList::ConstIterator it( list.constBegin() ), end( list.constEnd() ); + TQStringList::ConstIterator it( list.constBegin() ), end( list.constEnd() ); while( (! info) && (it != end) ) { interpretername = (*it); info = manager->getInterpreterInfo(interpretername); @@ -147,7 +147,7 @@ void KexiScriptDesignView::updateProperties() if(info) { d->properties->clear(); - QStringList interpreters = manager->getInterpreters(); + TQStringList interpreters = manager->getInterpreters(); KoProperty::Property::ListData* proplist = new KoProperty::Property::ListData(interpreters, interpreters); KoProperty::Property* prop = new KoProperty::Property( "language", // name @@ -190,8 +190,8 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope return; if(property.name() == "language") { - QString language = property.value().toString(); - kdDebug() << QString("KexiScriptDesignView::slotPropertyChanged() language=%1").arg(language) << endl; + TQString language = property.value().toString(); + kdDebug() << TQString("KexiScriptDesignView::slotPropertyChanged() language=%1").tqarg(language) << endl; d->scriptaction->setInterpreterName( language ); // We assume Kross and the HighlightingInterface are using same // names for the support languages... @@ -201,7 +201,7 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope else { bool ok = d->scriptaction->setOption( property.name(), property.value() ); if(! ok) { - kdWarning() << QString("KexiScriptDesignView::slotPropertyChanged() unknown property '%1'.").arg(property.name()) << endl; + kdWarning() << TQString("KexiScriptDesignView::slotPropertyChanged() unknown property '%1'.").tqarg(TQString(property.name())) << endl; return; } } @@ -212,40 +212,40 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope void KexiScriptDesignView::execute() { d->statusbrowser->clear(); - QTime time; + TQTime time; time.start(); - d->statusbrowser->append( i18n("Execution of the script \"%1\" started.").arg(d->scriptaction->name()) ); + d->statusbrowser->append( i18n("Execution of the script \"%1\" started.").tqarg(d->scriptaction->name()) ); d->scriptaction->activate(); if( d->scriptaction->hadException() ) { - QString errormessage = d->scriptaction->getException()->getError(); - d->statusbrowser->append(QString("<b>%2</b><br>").arg(QStyleSheet::escape(errormessage)) ); + TQString errormessage = d->scriptaction->getException()->getError(); + d->statusbrowser->append(TQString("<b>%2</b><br>").tqarg(TQStyleSheet::escape(errormessage)) ); - QString tracedetails = d->scriptaction->getException()->getTrace(); - d->statusbrowser->append( QStyleSheet::escape(tracedetails) ); + TQString tracedetails = d->scriptaction->getException()->getTrace(); + d->statusbrowser->append( TQStyleSheet::escape(tracedetails) ); long lineno = d->scriptaction->getException()->getLineNo(); if(lineno >= 0) d->editor->setLineNo(lineno); } else { - d->statusbrowser->append( i18n("Successfully executed. Time elapsed: %1ms").arg(time.elapsed()) ); + d->statusbrowser->append( i18n("Successfully executed. Time elapsed: %1ms").tqarg(time.elapsed()) ); } } bool KexiScriptDesignView::loadData() { - QString data; + TQString data; if(! loadDataBlock(data)) { kexipluginsdbg << "KexiScriptDesignView::loadData(): no DataBlock" << endl; return false; } - QString errMsg; + TQString errMsg; int errLine; int errCol; - QDomDocument domdoc; + TQDomDocument domdoc; bool parsed = domdoc.setContent(data, false, &errMsg, &errLine, &errCol); if(! parsed) { @@ -253,13 +253,13 @@ bool KexiScriptDesignView::loadData() return false; } - QDomElement scriptelem = domdoc.namedItem("script").toElement(); + TQDomElement scriptelem = domdoc.namedItem("script").toElement(); if(scriptelem.isNull()) { kexipluginsdbg << "KexiScriptDesignView::loadData(): script domelement is null" << endl; return false; } - QString interpretername = scriptelem.attribute("language"); + TQString interpretername = scriptelem.attribute("language"); Kross::Api::Manager* manager = Kross::Api::Manager::scriptManager(); Kross::Api::InterpreterInfo* info = interpretername.isEmpty() ? 0 : manager->getInterpreterInfo(interpretername); if(info) { @@ -268,10 +268,10 @@ bool KexiScriptDesignView::loadData() Kross::Api::InterpreterInfo::Option::Map options = info->getOptions(); Kross::Api::InterpreterInfo::Option::Map::ConstIterator it, end = options.constEnd(); for( it = options.constBegin(); it != end; ++it) { - QString value = scriptelem.attribute( it.data()->name ); + TQString value = scriptelem.attribute( it.data()->name ); if(! value.isNull()) { - QVariant v(value); - if( v.cast( it.data()->value.type() ) ) // preserve the QVariant's type + TQVariant v(value); + if( v.cast( it.data()->value.type() ) ) // preserve the TQVariant's type d->scriptaction->setOption(it.data()->name, v); } } @@ -295,7 +295,7 @@ KexiDB::SchemaData* KexiScriptDesignView::storeNewData(const KexiDB::SchemaData& if(! storeData()) { kdWarning() << "KexiScriptDesignView::storeNewData Failed to store the data." << endl; //failure: remove object's schema data to avoid garbage - KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection(); + KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection(); conn->removeObject( s->id() ); delete s; return 0; @@ -306,28 +306,28 @@ KexiDB::SchemaData* KexiScriptDesignView::storeNewData(const KexiDB::SchemaData& tristate KexiScriptDesignView::storeData(bool /*dontAsk*/) { - kexipluginsdbg << "KexiScriptDesignView::storeData(): " << parentDialog()->partItem()->name() << " [" << parentDialog()->id() << "]" << endl; + kexipluginsdbg << "KexiScriptDesignView::storeData(): " << tqparentDialog()->partItem()->name() << " [" << tqparentDialog()->id() << "]" << endl; - QDomDocument domdoc("script"); - QDomElement scriptelem = domdoc.createElement("script"); + TQDomDocument domdoc("script"); + TQDomElement scriptelem = domdoc.createElement("script"); domdoc.appendChild(scriptelem); - QString language = d->scriptaction->getInterpreterName(); + TQString language = d->scriptaction->getInterpreterName(); scriptelem.setAttribute("language", language); Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo(language); if(info) { Kross::Api::InterpreterInfo::Option::Map defoptions = info->getOptions(); - QMap<QString, QVariant>& options = d->scriptaction->getOptions(); - QMap<QString, QVariant>::ConstIterator it, end( options.constEnd() ); + TQMap<TQString, TQVariant>& options = d->scriptaction->getOptions(); + TQMap<TQString, TQVariant>::ConstIterator it, end( options.constEnd() ); for( it = options.constBegin(); it != end; ++it) { - if( defoptions.contains(it.key()) ) { // only remember options which the InterpreterInfo knows about... + if( defoptions.tqcontains(it.key()) ) { // only remember options which the InterpreterInfo knows about... scriptelem.setAttribute(it.key(), it.data().toString()); } } } - QDomText scriptcode = domdoc.createTextNode(d->scriptaction->getCode()); + TQDomText scriptcode = domdoc.createTextNode(d->scriptaction->getCode()); scriptelem.appendChild(scriptcode); return storeDataBlock( domdoc.toString() ); diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.h b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.h index cee1ed76..ac5240ed 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.h +++ b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.h @@ -46,13 +46,14 @@ namespace Kross { namespace Api { class KexiScriptDesignView : public KexiViewBase { Q_OBJECT + TQ_OBJECT public: /** * Constructor. */ - KexiScriptDesignView(KexiMainWindow *mainWin, QWidget *parent, Kross::Api::ScriptAction* scriptaction); + KexiScriptDesignView(KexiMainWindow *mainWin, TQWidget *tqparent, Kross::Api::ScriptAction* scriptaction); /** * Destructor. diff --git a/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp b/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp index a638af36..a6f2dfc1 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp +++ b/kexi/plugins/scripting/kexiscripting/kexiscripteditor.cpp @@ -41,8 +41,8 @@ class KexiScriptEditor::Private Private() : scriptaction(0) {} }; -KexiScriptEditor::KexiScriptEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name) - : KexiEditor(mainWin, parent, name) +KexiScriptEditor::KexiScriptEditor(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name) + : KexiEditor(mainWin, tqparent, name) , d( new Private() ) { } @@ -62,13 +62,13 @@ void KexiScriptEditor::initialize(Kross::Api::ScriptAction* scriptaction) d->scriptaction = scriptaction; Q_ASSERT(d->scriptaction); - disconnect(this, SIGNAL(textChanged()), this, SLOT(slotTextChanged())); + disconnect(this, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged())); - QString code = d->scriptaction->getCode(); + TQString code = d->scriptaction->getCode(); if(code.isNull()) { // If there is no code we just add some information. ///@todo remove after release - code = "# " + QStringList::split("\n", i18n( + code = "# " + TQStringList::split("\n", i18n( "This note will appear for a user in the script's source code " "as a comment. Keep every row not longer than 60 characters and use '\n.'", @@ -76,7 +76,7 @@ void KexiScriptEditor::initialize(Kross::Api::ScriptAction* scriptaction) "support in Kexi. The scripting API may change in details\n" "in the next Kexi version.\n" "For more information and documentation see\n%1" - ).arg("http://www.kexi-project.org/scripting/"), true).join("\n# ") + "\n"; + ).tqarg("http://www.kexi-project.org/scripting/"), true).join("\n# ") + "\n"; } KexiEditor::setText(code); // We assume Kross and the HighlightingInterface are using same @@ -85,7 +85,7 @@ void KexiScriptEditor::initialize(Kross::Api::ScriptAction* scriptaction) clearUndoRedo(); KexiEditor::setDirty(false); - connect(this, SIGNAL(textChanged()), this, SLOT(slotTextChanged())); + connect(this, TQT_SIGNAL(textChanged()), this, TQT_SLOT(slotTextChanged())); } void KexiScriptEditor::slotTextChanged() diff --git a/kexi/plugins/scripting/kexiscripting/kexiscripteditor.h b/kexi/plugins/scripting/kexiscripting/kexiscripteditor.h index 1ef02ff9..22415a7b 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscripteditor.h +++ b/kexi/plugins/scripting/kexiscripting/kexiscripteditor.h @@ -36,13 +36,14 @@ namespace Kross { namespace Api { class KexiScriptEditor : public KexiEditor { Q_OBJECT + TQ_OBJECT public: /** * Constructor. */ - KexiScriptEditor(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0); + KexiScriptEditor(KexiMainWindow *mainWin, TQWidget *tqparent, const char *name = 0); /** * Destructor. diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp b/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp index d650e958..b778bc75 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp +++ b/kexi/plugins/scripting/kexiscripting/kexiscriptpart.cpp @@ -44,8 +44,8 @@ class KexiScriptPart::Private Kross::Api::ScriptGUIClient* scriptguiclient; }; -KexiScriptPart::KexiScriptPart(QObject *parent, const char *name, const QStringList &l) - : KexiPart::Part(parent, name, l) +KexiScriptPart::KexiScriptPart(TQObject *tqparent, const char *name, const TQStringList &l) + : KexiPart::Part(tqparent, name, l) , d( new Private() ) { d->scriptguiclient = 0; @@ -68,7 +68,7 @@ KexiScriptPart::~KexiScriptPart() delete d; } -bool KexiScriptPart::execute(KexiPart::Item* item, QObject* sender) +bool KexiScriptPart::execute(KexiPart::Item* item, TQObject* sender) { Q_UNUSED(sender); @@ -88,21 +88,21 @@ bool KexiScriptPart::execute(KexiPart::Item* item, QObject* sender) Kross::Api::ScriptAction* scriptaction = view->scriptAction(); if(scriptaction) { - const QString dontAskAgainName = "askExecuteScript"; + const TQString dontAskAgainName = "askExecuteScript"; KConfig* config = KGlobal::config(); - QString dontask = config->readEntry(dontAskAgainName).lower(); + TQString dontask = config->readEntry(dontAskAgainName).lower(); bool exec = (dontask == "yes"); if( !exec && dontask != "no" ) { exec = KMessageBox::warningContinueCancel(0, - i18n("Do you want to execute the script \"%1\"?\n\nScripts obtained from unknown sources can contain dangerous code.").arg(scriptaction->text()), + i18n("Do you want to execute the script \"%1\"?\n\nScripts obtained from unknown sources can contain dangerous code.").tqarg(scriptaction->text()), i18n("Execute Script?"), KGuiItem(i18n("Execute"), "exec"), dontAskAgainName, KMessageBox::Notify | KMessageBox::Dangerous ) == KMessageBox::Continue; } if(exec) { - //QTimer::singleShot(10, scriptaction, SLOT(activate())); + //TQTimer::singleShot(10, scriptaction, TQT_SLOT(activate())); d->scriptguiclient->executeScriptAction( scriptaction ); } } @@ -124,12 +124,12 @@ void KexiScriptPart::initPartActions() // scripting-plugin depends on this instance and loading the plugin will // fail if it's not avaiable. if(! Kross::Api::Manager::scriptManager()->hasChild("KexiMainWindow")) { - Kross::Api::Manager::scriptManager()->addQObject(m_mainWin, "KexiMainWindow"); + Kross::Api::Manager::scriptManager()->addTQObject(TQT_TQOBJECT(m_mainWin), "KexiMainWindow"); // Add the KAction's provided by the ScriptGUIClient to the // KexiMainWindow. //FIXME: fix+use createSharedPartAction() whyever it doesn't work as expected right now... - QPopupMenu* popup = m_mainWin->findPopupMenu("tools"); + TQPopupMenu* popup = m_mainWin->findPopupMenu("tools"); if(popup) { KAction* execscriptaction = d->scriptguiclient->action("executescriptfile"); if(execscriptaction) @@ -159,9 +159,9 @@ void KexiScriptPart::initInstanceActions() createSharedAction(Kexi::DesignViewMode, i18n("Configure Editor..."), "configure", 0, "script_config_editor"); } -KexiViewBase* KexiScriptPart::createView(QWidget *parent, KexiDialogBase* dialog, KexiPart::Item& item, int viewMode, QMap<QString,QString>*) +KexiViewBase* KexiScriptPart::createView(TQWidget *tqparent, KexiDialogBase* dialog, KexiPart::Item& item, int viewMode, TQMap<TQString,TQString>*) { - QString partname = item.name(); + TQString partname = item.name(); if( ! partname.isNull() ) { KexiMainWindow *win = dialog->mainWin(); if(!win || !win->project() || !win->project()->dbConnection()) @@ -181,13 +181,13 @@ KexiViewBase* KexiScriptPart::createView(QWidget *parent, KexiDialogBase* dialog } if(viewMode == Kexi::DesignViewMode) { - return new KexiScriptDesignView(win, parent, scriptaction); + return new KexiScriptDesignView(win, tqparent, scriptaction); } } return 0; } -QString KexiScriptPart::i18nMessage(const QCString& englishMessage) const +TQString KexiScriptPart::i18nMessage(const TQCString& englishMessage) const { if (englishMessage=="Design of object \"%1\" has been modified.") return i18n("Design of script \"%1\" has been modified."); diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptpart.h b/kexi/plugins/scripting/kexiscripting/kexiscriptpart.h index ddba0d72..eca7a001 100644 --- a/kexi/plugins/scripting/kexiscripting/kexiscriptpart.h +++ b/kexi/plugins/scripting/kexiscripting/kexiscriptpart.h @@ -22,8 +22,8 @@ #ifndef KEXISCRIPTPART_H #define KEXISCRIPTPART_H -#include <qdom.h> -#include <qcstring.h> +#include <tqdom.h> +#include <tqcstring.h> #include <kexi.h> #include <kexipart.h> @@ -35,17 +35,18 @@ class KexiScriptPart : public KexiPart::Part { Q_OBJECT + TQ_OBJECT public: /** * Constructor. * - * \param parent The parent QObject this part is child of. + * \param tqparent The tqparent TQObject this part is child of. * \param name The name this part has. * \param args Optional list of arguments passed to this part. */ - KexiScriptPart(QObject *parent, const char *name, const QStringList& args); + KexiScriptPart(TQObject *tqparent, const char *name, const TQStringList& args); /** * Destructor. @@ -56,28 +57,28 @@ class KexiScriptPart : public KexiPart::Part * Implementation of the \a KexiPart::Part::execute method used to * execute the passed \p item instance. */ - virtual bool execute(KexiPart::Item* item, QObject* sender = 0); + virtual bool execute(KexiPart::Item* item, TQObject* sender = 0); /** * \return the i18n message for the passed \p englishMessage string. */ - virtual QString i18nMessage(const QCString& englishMessage) const; + virtual TQString i18nMessage(const TQCString& englishMessage) const; protected: /** * Create a new view. * - * \param parent The parent QWidget the new view is displayed in. + * \param tqparent The tqparent TQWidget the new view is displayed in. * \param dialog The \a KexiDialogBase the view is child of. * \param item The \a KexiPart::Item this view is for. * \param viewMode The viewmode we like to have a view for. */ - virtual KexiViewBase* createView(QWidget *parent, + virtual KexiViewBase* createView(TQWidget *tqparent, KexiDialogBase* dialog, KexiPart::Item& item, int viewMode = Kexi::DesignViewMode, - QMap<QString,QString>* staticObjectArgs = 0); + TQMap<TQString,TQString>* staticObjectArgs = 0); /** * Initialize the part's actions. diff --git a/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py b/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py index 3718512f..3a2734aa 100644 --- a/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py +++ b/kexi/plugins/scripting/scripts/copycenter/CopyCenter.py @@ -89,14 +89,14 @@ def runGuiApp(copycenter, name): #-------------------------------------------------------------------- class ListViewDialog(qt.QDialog): - def __init__(self, parent, caption): - qt.QDialog.__init__(self, parent, "ProgressDialog", 1) - self.parent = parent + def __init__(self, tqparent, caption): + qt.QDialog.__init__(self, tqparent, "ProgressDialog", 1) + self.tqparent = tqparent self.setCaption(caption) - layout = qt.QVBoxLayout(self) + tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(2) - layout.addWidget(box) + tqlayout.addWidget(box) self.listview = qt.QListView(box) self.listview.setAllColumnsShowFocus(True) self.listview.header().setStretchEnabled(True,0) @@ -124,9 +124,9 @@ def runGuiApp(copycenter, name): #-------------------------------------------------------------------- class CopyJobWidget(qt.QVBox): - def __init__(self,dialog,parent): + def __init__(self,dialog,tqparent): self.dialog = dialog - qt.QVBox.__init__(self,parent) + qt.QVBox.__init__(self,tqparent) self.setSpacing(6) typebox = qt.QHBox(self) typebox.setSpacing(6) @@ -165,7 +165,7 @@ def runGuiApp(copycenter, name): def doubleClicked(self, **args): print "CopyJobWidget.doubleClicked" item = self.listview.selectedItem() - if item and item.parent(): item.startRename(1) + if item and item.tqparent(): item.startRename(1) def readOptions(self,domnode,plugininst): print "CopyJobWidget.readOptions plugintype=\"%s\"" % plugininst.plugintype @@ -210,13 +210,13 @@ def runGuiApp(copycenter, name): if filename != "": self.jobfilecombobox.setCurrentText(filename) def escape(self,s): - return s.replace("&", "&").replace("'", "'").replace("<", "<").replace(">", ">").replace('"', """) + return s.tqreplace("&", "&").tqreplace("'", "'").tqreplace("<", "<").tqreplace(">", ">").tqreplace('"', """) def writeOptions(self,writer,pluginname,plugininst): print "CopyJobWidget.writeOptions" writer.write("<%s plugin=\"%s\">\n" % (plugininst.plugintype, pluginname)) for optionname in plugininst.options: - value = self.escape( unicode(plugininst.options[optionname]).encode("utf-8") ) + value = self.escape( tqunicode(plugininst.options[optionname]).encode("utf-8") ) writer.write("\t<%s value=\"%s\" />\n" % (optionname,value)) writer.write("</%s>\n" % plugininst.plugintype) @@ -238,19 +238,19 @@ def runGuiApp(copycenter, name): f.close() print "File \%s\" successfully written." % filename - def addItem(self, pluginimpl, afteritem = None, parentitem = None): + def addItem(self, pluginimpl, afteritem = None, tqparentitem = None): #print "CopyJobWidget.addItem" class ListViewItem(qt.QListViewItem): - def __init__(self, pluginimpl, listview, parentitem = None, afteritem = None): + def __init__(self, pluginimpl, listview, tqparentitem = None, afteritem = None): self.pluginimpl = pluginimpl - if parentitem == None: + if tqparentitem == None: qt.QListViewItem.__init__(self,listview) self.setOpen(True) else: if afteritem == None: - qt.QListViewItem.__init__(self,parentitem) + qt.QListViewItem.__init__(self,tqparentitem) else: - qt.QListViewItem.__init__(self,parentitem,afteritem) + qt.QListViewItem.__init__(self,tqparentitem,afteritem) self.setRenameEnabled(1,True) def startRename(self, columnindex): qt.QListViewItem.startRename(self,columnindex) @@ -271,10 +271,10 @@ def runGuiApp(copycenter, name): def text(self, columnindex): if columnindex == 1: - if qt.QListViewItem.text(self,0).contains("password"): + if qt.QListViewItem.text(self,0).tqcontains("password"): return "*" * len(str(qt.QListViewItem.text(self,1))) return qt.QListViewItem.text(self,columnindex) - return ListViewItem(pluginimpl, self.listview, parentitem, afteritem) + return ListViewItem(pluginimpl, self.listview, tqparentitem, afteritem) def updateItem(self,pluginname,pluginimpl): #print "CopyJobWidget.updateItem" @@ -309,31 +309,31 @@ def runGuiApp(copycenter, name): self.starttime = None qt.QDialog.__init__(self, dialog, "ProgressDialog", 1) self.setCaption("Copying...") - layout = qt.QVBoxLayout(self) + tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setSpacing(6) box.setMargin(6) - layout.addWidget(box) + tqlayout.addWidget(box) self.textbrowser = qt.QTextBrowser(box) self.textbrowser.setWordWrap(qt.QTextEdit.WidgetWidth) self.textbrowser.setTextFormat(qt.Qt.RichText) statusbox = qt.QFrame(box) - layout = qt.QGridLayout(statusbox,4,2,0,2) - layout.addWidget(qt.QLabel("Number of records done:",statusbox),0,0) + tqlayout = qt.QGridLayout(statusbox,4,2,0,2) + tqlayout.addWidget(qt.QLabel("Number of records done:",statusbox),0,0) self.donecounter = 0 self.donelabel = qt.QLabel("-",statusbox) - layout.addWidget(self.donelabel,0,1) - layout.addWidget(qt.QLabel("Successfully copied records:",statusbox),1,0) + tqlayout.addWidget(self.donelabel,0,1) + tqlayout.addWidget(qt.QLabel("Successfully copied records:",statusbox),1,0) self.successcounter = 0 self.successlabel = qt.QLabel("-",statusbox) - layout.addWidget(self.successlabel,1,1) - layout.addWidget(qt.QLabel("Failed to copy records:",statusbox),2,0) + tqlayout.addWidget(self.successlabel,1,1) + tqlayout.addWidget(qt.QLabel("Failed to copy records:",statusbox),2,0) self.failedcounter = 0 self.failedlabel = qt.QLabel("-",statusbox) - layout.addWidget(self.failedlabel,2,1) - layout.addWidget(qt.QLabel("Elapsed time in seconds:",statusbox),3,0) + tqlayout.addWidget(self.failedlabel,2,1) + tqlayout.addWidget(qt.QLabel("Elapsed time in seconds:",statusbox),3,0) self.elapsedlabel = qt.QLabel("-",statusbox) - layout.addWidget(self.elapsedlabel,3,1) + tqlayout.addWidget(self.elapsedlabel,3,1) btnbox = qt.QHBox(box) btnbox.setSpacing(6) self.donebtn = qt.QPushButton(btnbox) @@ -359,11 +359,11 @@ def runGuiApp(copycenter, name): def writeSuccess(self, record, rowcount): self.donecounter += rowcount self.successcounter += rowcount - qt.qApp.processEvents() + qt.tqApp.processEvents() def writeFailed(self, record): self.donecounter += 1 self.failedcounter += 1 - qt.qApp.processEvents() + qt.tqApp.processEvents() def startCopy(self): try: @@ -397,7 +397,7 @@ def runGuiApp(copycenter, name): self.starttime.start() self.updatetimer.start(500) - qt.qApp.processEvents() + qt.tqApp.processEvents() # Copy the records self.textbrowser.append("<hr><i>Copy the records...</i>") @@ -428,7 +428,7 @@ def runGuiApp(copycenter, name): def show(self): qt.QDialog.show(self) qt.QTimer.singleShot(10,self.startCopy) - qt.qApp.processEvents() + qt.tqApp.processEvents() def closeEvent(self, closeevent): if not self.dialog.getSourcePluginImpl().isFinished(): @@ -442,13 +442,13 @@ def runGuiApp(copycenter, name): #-------------------------------------------------------------------- class DataSelector(qt.QVGroupBox): - def __init__(self, plugintype, title, caption, parent, dialog, items): + def __init__(self, plugintype, title, caption, tqparent, dialog, items): self.plugintype = plugintype self.pluginimpl = None self.dialog = dialog self.mainbox = None - qt.QVGroupBox.__init__(self,title,parent) + qt.QVGroupBox.__init__(self,title,tqparent) self.setInsideMargin(6) self.setInsideSpacing(0) @@ -520,7 +520,7 @@ def runGuiApp(copycenter, name): #-------------------------------------------------------------------- class Dialog(qt.QDialog): - def __init__(self, copycenter, parent): + def __init__(self, copycenter, tqparent): self.copycenter = copycenter import qt @@ -528,13 +528,13 @@ def runGuiApp(copycenter, name): import sys self.ListViewDialog = ListViewDialog - qt.QDialog.__init__(self, parent, "Dialog", 1, qt.Qt.WDestructiveClose) + qt.QDialog.__init__(self, tqparent, "Dialog", 1, qt.Qt.WDestructiveClose) self.setCaption("Copy Center") - layout = qt.QVBoxLayout(self) + tqlayout = qt.QVBoxLayout(self) box = qt.QVBox(self) box.setMargin(6) box.setSpacing(6) - layout.addWidget(box) + tqlayout.addWidget(box) self.tab = qt.QTabWidget(box) self.tab.setMargin(6) box.setStretchFactor(self.tab,1) @@ -629,7 +629,7 @@ def runGuiApp(copycenter, name): if name == "__main__": qtapp = qt.QApplication(sys.argv) else: - qtapp = qt.qApp + qtapp = qt.tqApp dialog = Dialog(copycenter, qtapp.mainWidget()) dialog.exec_loop() diff --git a/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginKexiDB.py b/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginKexiDB.py index e8241405..85023ee4 100644 --- a/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginKexiDB.py +++ b/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginKexiDB.py @@ -53,9 +53,9 @@ class CopyCenterPlugin: def finish(self): """ Called if reading is finished.""" self.connection.finish() - def createWidget(self, dialog, parent): + def createWidget(self, dialog, tqparent): """ Create and return a widget to modify the plugin settings. """ - return self.copycenterplugin.createWidget(dialog, self, parent) + return self.copycenterplugin.createWidget(dialog, self, tqparent) class Source(Plugin): """ Specialization of the Plugin class to implement the @@ -196,7 +196,7 @@ class CopyCenterPlugin: self.drivermanager = krosskexidb.DriverManager() self.copycenter = copycenter - def createWidget(self, dialog, plugin, parent): + def createWidget(self, dialog, plugin, tqparent): """ Each plugin may provide a qt.QWidget back to the CopyCenter.py. The widget will be used to configure our plugin settings. """ @@ -208,12 +208,12 @@ class CopyCenterPlugin: self.dialog = dialog self.mainbox = None class ProjectBox(qt.QHBox): - def __init__(self,main,copycenterplugin,plugin,parent): + def __init__(self,main,copycenterplugin,plugin,tqparent): self.main = main self.copycenterplugin = copycenterplugin self.plugin = plugin - qt.QHBox.__init__(self,parent) + qt.QHBox.__init__(self,tqparent) prjlabel = qt.QLabel("Project File:",self) self.prjcombo = qt.QComboBox(self) self.prjcombo.setEditable(True) @@ -244,8 +244,8 @@ class CopyCenterPlugin: if str(filename) != "": self.prjcombo.setCurrentText(str(filename)) class DriverBox(qt.QVBox): - def __init__(self,main,parent): - qt.QVBox.__init__(self,parent) + def __init__(self,main,tqparent): + qt.QVBox.__init__(self,tqparent) self.main = main self.copycenterplugin = main.copycenterplugin self.plugin = main.plugin @@ -364,8 +364,8 @@ class CopyCenterPlugin: if str(filename) != "": self.sockfileedit.setText(str(filename)) class TableBox(qt.QHBox): - def __init__(self,copycenterplugin,plugin,parent): - qt.QHBox.__init__(self,parent) + def __init__(self,copycenterplugin,plugin,tqparent): + qt.QHBox.__init__(self,tqparent) self.copycenterplugin = copycenterplugin self.plugin = plugin tablelabel = qt.QLabel("Table:",self) @@ -405,8 +405,8 @@ class CopyCenterPlugin: dialog.show() class FieldBox(qt.QHBox): - def __init__(self,copycenterplugin,plugin,parent): - qt.QHBox.__init__(self,parent) + def __init__(self,copycenterplugin,plugin,tqparent): + qt.QHBox.__init__(self,tqparent) self.copycenterplugin = copycenterplugin self.plugin = plugin self.tablename = "" @@ -462,15 +462,15 @@ class CopyCenterPlugin: self.fieldsbtn.setEnabled(False) class MainBox(qt.QHBox): - def __init__(self,copycenterplugin,plugin,parent): - qt.QHBox.__init__(self,parent) + def __init__(self,copycenterplugin,plugin,tqparent): + qt.QHBox.__init__(self,tqparent) self.copycenterplugin = copycenterplugin self.plugin = plugin - self.prjbox = ProjectBox(self,copycenterplugin,plugin,parent) - self.driverbox = DriverBox(self,parent) + self.prjbox = ProjectBox(self,copycenterplugin,plugin,tqparent) + self.driverbox = DriverBox(self,tqparent) - statusbar = qt.QHBox(parent) + statusbar = qt.QHBox(tqparent) statusbar.setSpacing(2) #self.statuslabel = qt.QLabel("Disconnected",statusbar) #statusbar.setStretchFactor(self.statuslabel,1) @@ -482,9 +482,9 @@ class CopyCenterPlugin: self.disconnectbtn.setEnabled(False) qt.QObject.connect(self.disconnectbtn, qt.SIGNAL("clicked()"),self.disconnectClicked) - #self.connectionbox = ConnectionBox(copycenterplugin,plugin,parent) - self.tablebox = TableBox(copycenterplugin,plugin,parent) - self.fieldbox = FieldBox(copycenterplugin,plugin,parent) + #self.connectionbox = ConnectionBox(copycenterplugin,plugin,tqparent) + self.tablebox = TableBox(copycenterplugin,plugin,tqparent) + self.fieldbox = FieldBox(copycenterplugin,plugin,tqparent) qt.QObject.connect(self.tablebox.tableedit, qt.SIGNAL("textChanged(const QString&)"), self.fieldbox.tableChanged) if self.plugin.options['project'] != '': @@ -499,7 +499,7 @@ class CopyCenterPlugin: pass if self.plugin.plugintype == "Destination": - #typebox = qt.QHBox(parent) + #typebox = qt.QHBox(tqparent) #label = qt.QLabel("Operation:",typebox) #combobox = qt.QComboBox(typebox) #combobox.insertItem("Append") @@ -511,15 +511,15 @@ class CopyCenterPlugin: #typebox.setStretchFactor(combobox,1) pass elif self.plugin.plugintype == "Source": - wherebox = qt.QHBox(parent) + wherebox = qt.QHBox(tqparent) wherelabel = qt.QLabel("Where:",wherebox) self.whereedit = qt.QLineEdit(self.plugin.options['where'],wherebox) - #orderbox = qt.QHBox(parent) + #orderbox = qt.QHBox(tqparent) #orderlabel = qt.QLabel("Order By:",orderbox) #orderedit = qt.QLineEdit("",orderbox) - #errbox = qt.QHBox(parent) + #errbox = qt.QHBox(tqparent) #errlabel = qt.QLabel("On Error:",errbox) #errcombo = qt.QComboBox(errbox) #errcombo.insertItem("Ask") @@ -640,7 +640,7 @@ class CopyCenterPlugin: pass return "" - mainbox = MainBox(self,plugin,parent) + mainbox = MainBox(self,plugin,tqparent) plugin.widget = mainbox return mainbox diff --git a/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py b/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py index 985d757d..de553b92 100644 --- a/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py +++ b/kexi/plugins/scripting/scripts/copycenter/CopyCenterPluginQtSQL.py @@ -39,8 +39,8 @@ class CopyCenterPlugin: def finish(self): self.isfinished = True self.widget.disconnectClicked() - def createWidget(self,dialog,parent): - return self.copycenterplugin.widget(dialog, self, parent) + def createWidget(self,dialog,tqparent): + return self.copycenterplugin.widget(dialog, self, tqparent) class Source(Plugin): plugintype = "Source" @@ -84,7 +84,7 @@ class CopyCenterPlugin: return None record = [] for fieldname in self.fieldlist: - record.append( unicode(self.cursor.value(fieldname).toString()).encode("latin-1") ) + record.append( tqunicode(self.cursor.value(fieldname).toString()).encode("latin-1") ) #print "read record: %s" % record return record @@ -145,8 +145,8 @@ class CopyCenterPlugin: cursorrecord.setValue(self.fieldlist[i], v) rowcount = self.cursor.insert() if rowcount < 1: - drv = unicode(self.cursor.lastError().driverText()).encode("latin-1") - db = unicode(self.cursor.lastError().databaseText()).encode("latin-1") + drv = tqunicode(self.cursor.lastError().driverText()).encode("latin-1") + db = tqunicode(self.cursor.lastError().databaseText()).encode("latin-1") print "failed: %s %s" % (drv,db) self.copierer.writeFailed(record) else: @@ -209,7 +209,7 @@ class CopyCenterPlugin: """ Constructor. """ pass - def widget(self,dialog,plugin,parent): + def widget(self,dialog,plugin,tqparent): """ Each plugin may provide a qt.QWidget back to the CopyCenter.py. The widget will be used to configure our plugin settings. """ @@ -246,7 +246,7 @@ class CopyCenterPlugin: class FieldsDialog(ListViewDialog): def __init__(self, mainwidget): - ListViewDialog.__init__(self,parent,"Fields") + ListViewDialog.__init__(self,tqparent,"Fields") self.mainwidget = mainwidget self.listview.setSelectionMode(qt.QListView.Multi) self.listview.setSorting(-1) @@ -280,14 +280,14 @@ class CopyCenterPlugin: class MainWidget(qt.QHBox): - def __init__(self,plugin,dialog,parent): + def __init__(self,plugin,dialog,tqparent): import qt import qtsql - qt.QHBox.__init__(self,parent) + qt.QHBox.__init__(self,tqparent) self.dialog = dialog self.plugin = plugin - self.connectionbox = qt.QVBox(parent) + self.connectionbox = qt.QVBox(tqparent) self.connectionbox.setSpacing(2) driverbox = qt.QHBox(self.connectionbox) @@ -331,7 +331,7 @@ class CopyCenterPlugin: dblabel.setBuddy(self.dbedit) dbbox.setStretchFactor(self.dbedit,1) - statusbar = qt.QHBox(parent) + statusbar = qt.QHBox(tqparent) statusbar.setSpacing(2) statusbar.setStretchFactor(qt.QWidget(statusbar),1) self.connectbtn = qt.QPushButton("Connect",statusbar) @@ -340,7 +340,7 @@ class CopyCenterPlugin: self.disconnectbtn.setEnabled(False) qt.QObject.connect(self.disconnectbtn, qt.SIGNAL("clicked()"),self.disconnectClicked) - tablebox = qt.QHBox(parent) + tablebox = qt.QHBox(tqparent) tablelabel = qt.QLabel("Table:",tablebox) self.tableedit = qt.QLineEdit(self.plugin.options['table'],tablebox) qt.QObject.connect(self.tableedit, qt.SIGNAL("textChanged(const QString&)"), self.tableEditChanged) @@ -350,7 +350,7 @@ class CopyCenterPlugin: tablelabel.setBuddy(self.tableedit) tablebox.setStretchFactor(self.tableedit,1) - fieldbox = qt.QHBox(parent) + fieldbox = qt.QHBox(tqparent) fieldlabel = qt.QLabel("Fields:",fieldbox) self.fieldedit = qt.QLineEdit(self.plugin.options['fields'],fieldbox) self.fieldbtn = qt.QPushButton("...",fieldbox) @@ -360,7 +360,7 @@ class CopyCenterPlugin: fieldbox.setStretchFactor(self.fieldedit,1) if self.plugin.plugintype == "Source": - box = qt.QHBox(parent) + box = qt.QHBox(tqparent) wherelabel = qt.QLabel("Where:",box) self.whereedit = qt.QLineEdit(self.plugin.options['where'],box) wherelabel.setBuddy(self.whereedit) @@ -368,9 +368,9 @@ class CopyCenterPlugin: elif self.plugin.plugintype == "Destination": class OperationBox(qt.QVBox): - def __init__(self, mainwidget, parent): + def __init__(self, mainwidget, tqparent): self.mainwidget = mainwidget - qt.QVBox.__init__(self, parent) + qt.QVBox.__init__(self, tqparent) opbox = qt.QHBox(self) operationlabel = qt.QLabel("Operation:",opbox) self.mainwidget.operationedit = qt.QComboBox(opbox) @@ -401,7 +401,7 @@ class CopyCenterPlugin: 1: showUpdate, }[ self.mainwidget.operationedit.currentItem() ](self) if self.box != None: self.box.show() - OperationBox(self,parent) + OperationBox(self,tqparent) def tableEditChanged(self,text): if self.plugin.database != None and self.plugin.database.isOpen(): @@ -491,5 +491,5 @@ class CopyCenterPlugin: print "database is closed now!" self.updateConnectState() - plugin.widget = MainWidget(plugin,self.dialog,parent) + plugin.widget = MainWidget(plugin,self.dialog,tqparent) return plugin.widget diff --git a/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py b/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py index cace0340..9febfcdd 100644 --- a/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py +++ b/kexi/plugins/scripting/scripts/exportxhtml/ExportXHTML.py @@ -83,7 +83,7 @@ class HtmlExporter: def htmlescape(self, text): import string - return string.replace(string.replace(string.replace(str(text),'&','&'),'<','<'),'>','>') + return string.tqreplace(string.tqreplace(string.tqreplace(str(text),'&','&'),'<','<'),'>','>') def write(self, output, style): name = self.datasource.name() @@ -131,7 +131,7 @@ class HtmlExporter: if items == None: break output.write("<tr>") for item in items: - u = unicode(str(self.htmlescape(item)),"latin-1") + u = tqunicode(str(self.htmlescape(item)),"latin-1") output.write("<td>%s</td>" % u.encode("utf-8")) output.write("</tr>\n") output.write("</table>\n") diff --git a/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py b/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py index 200b3dee..6ca94f9a 100755 --- a/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py +++ b/kexi/plugins/scripting/scripts/importxhtml/ImportXHTML.py @@ -124,9 +124,9 @@ class SaxInput: was parsed. """ if self.field != None: - # the xml-data is unicode and we need to encode it + # the xml-data is tqunicode and we need to encode it # to latin-1 cause KexiDB deals only with latin-1. - u = unicode(chars[offset:offset+length]) + u = tqunicode(chars[offset:offset+length]) self.field.append(u.encode("latin-1")) # start the job |