diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/kexidb/drivers | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kexi/kexidb/drivers')
39 files changed, 494 insertions, 485 deletions
diff --git a/kexi/kexidb/drivers/mySQL/mySQL.pro b/kexi/kexidb/drivers/mySQL/mySQL.pro index cc6eddd6..6c443be3 100644 --- a/kexi/kexidb/drivers/mySQL/mySQL.pro +++ b/kexi/kexidb/drivers/mySQL/mySQL.pro @@ -2,11 +2,11 @@ include( ../common.pro ) INCLUDEPATH += $(MYSQL_INC) $(MYSQL_INC)/mysql -contains(CONFIG,debug) { +tqcontains(CONFIG,debug) { win32:LIBS += $(MYSQL_LIB)/debug/libmysql.lib win32:QMAKE_LFLAGS += /NODEFAULTLIB:LIBCMTD.LIB } -!contains(CONFIG,debug) { +!tqcontains(CONFIG,debug) { # win32:LIBS += $(MYSQL_LIB)/opt/mysqlclient.lib win32:LIBS += $(MYSQL_LIB)/opt/libmysql.lib # win32:QMAKE_LFLAGS += /NODEFAULTLIB:MSVCRT.LIB @@ -14,7 +14,7 @@ contains(CONFIG,debug) { TARGET = kexidb_mysqldriver$$KDELIBDEBUG -system( bash kmoc ) +system( bash ktqmoc ) SOURCES = \ mysqlconnection_p.cpp \ diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp index 7417b698..18682a4f 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqlconnection.cpp @@ -20,10 +20,10 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qvariant.h> -#include <qfile.h> -#include <qdict.h> -#include <qregexp.h> +#include <tqvariant.h> +#include <tqfile.h> +#include <tqdict.h> +#include <tqregexp.h> #include <kgenericfactory.h> #include <kdebug.h> @@ -68,9 +68,9 @@ bool MySqlConnection::drv_connect(KexiDB::ServerVersionInfo& version) version.release = v - version.major*10000 - version.minor*100; #else //better way to get the version info: use 'version' built-in variable: //! @todo this is hardcoded for now; define api for retrieving variables and use this API... - QString versionString; + TQString versionString; const tristate res = querySingleString("SELECT @@version", versionString, /*column*/0, false /*!addLimitTo1*/); - QRegExp versionRe("(\\d+)\\.(\\d+)\\.(\\d+)"); + TQRegExp versionRe("(\\d+)\\.(\\d+)\\.(\\d+)"); if (res==true && versionRe.exactMatch(versionString)) { // (if querySingleString failed, the version will be 0.0.0... version.major = versionRe.cap(1).toInt(); version.minor = versionRe.cap(2).toInt(); @@ -84,7 +84,7 @@ bool MySqlConnection::drv_disconnect() { return d->db_disconnect(); } -Cursor* MySqlConnection::prepareQuery(const QString& statement, uint cursor_options) { +Cursor* MySqlConnection::prepareQuery(const TQString& statement, uint cursor_options) { return new MySqlCursor(this,statement,cursor_options); } @@ -92,7 +92,7 @@ Cursor* MySqlConnection::prepareQuery( QuerySchema& query, uint cursor_options ) return new MySqlCursor( this, query, cursor_options ); } -bool MySqlConnection::drv_getDatabasesList( QStringList &list ) { +bool MySqlConnection::drv_getDatabasesList( TQStringList &list ) { KexiDBDrvDbg << "MySqlConnection::drv_getDatabasesList()" << endl; list.clear(); MYSQL_RES *res; @@ -100,7 +100,7 @@ bool MySqlConnection::drv_getDatabasesList( QStringList &list ) { if((res=mysql_list_dbs(d->mysql,0)) != 0) { MYSQL_ROW row; while ( (row = mysql_fetch_row(res))!=0) { - list<<QString(row[0]); + list<<TQString(row[0]); } mysql_free_result(res); return true; @@ -111,7 +111,7 @@ bool MySqlConnection::drv_getDatabasesList( QStringList &list ) { return false; } -bool MySqlConnection::drv_createDatabase( const QString &dbName) { +bool MySqlConnection::drv_createDatabase( const TQString &dbName) { KexiDBDrvDbg << "MySqlConnection::drv_createDatabase: " << dbName << endl; // mysql_create_db deprecated, use SQL here. if (drv_executeSQL("CREATE DATABASE " + (dbName))) @@ -120,7 +120,7 @@ bool MySqlConnection::drv_createDatabase( const QString &dbName) { return false; } -bool MySqlConnection::drv_useDatabase(const QString &dbName, bool *cancelled, MessageHandler* msgHandler) +bool MySqlConnection::drv_useDatabase(const TQString &dbName, bool *cancelled, MessageHandler* msgHandler) { Q_UNUSED(cancelled); Q_UNUSED(msgHandler); @@ -134,19 +134,19 @@ bool MySqlConnection::drv_closeDatabase() { return true; } -bool MySqlConnection::drv_dropDatabase( const QString &dbName) { +bool MySqlConnection::drv_dropDatabase( const TQString &dbName) { //TODO is here escaping needed return drv_executeSQL("drop database "+dbName); } -bool MySqlConnection::drv_executeSQL( const QString& statement ) { +bool MySqlConnection::drv_executeSQL( const TQString& statement ) { return d->executeSQL(statement); } -Q_ULLONG MySqlConnection::drv_lastInsertRowID() +TQ_ULLONG MySqlConnection::drv_lastInsertRowID() { //! @todo - return (Q_ULLONG)mysql_insert_id(d->mysql); + return (TQ_ULLONG)mysql_insert_id(d->mysql); } int MySqlConnection::serverResult() @@ -154,9 +154,9 @@ int MySqlConnection::serverResult() return d->res; } -QString MySqlConnection::serverResultName() +TQString MySqlConnection::serverResultName() { - return QString::null; + return TQString(); } void MySqlConnection::drv_clearServerResult() @@ -166,19 +166,19 @@ void MySqlConnection::drv_clearServerResult() d->res = 0; } -QString MySqlConnection::serverErrorMsg() +TQString MySqlConnection::serverErrorMsg() { return d->errmsg; } -bool MySqlConnection::drv_containsTable( const QString &tableName ) +bool MySqlConnection::drv_containsTable( const TQString &tableName ) { bool success; - return resultExists(QString("show tables like %1") - .arg(driver()->escapeString(tableName)), success) && success; + return resultExists(TQString("show tables like %1") + .tqarg(driver()->escapeString(tableName)), success) && success; } -bool MySqlConnection::drv_getTablesList( QStringList &list ) +bool MySqlConnection::drv_getTablesList( TQStringList &list ) { KexiDB::Cursor *cursor; m_sql = "show tables"; diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection.h b/kexi/kexidb/drivers/mySQL/mysqlconnection.h index bafb889d..e0fb4382 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlconnection.h +++ b/kexi/kexidb/drivers/mySQL/mysqlconnection.h @@ -22,11 +22,11 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, #ifndef MYSQLCONNECTION_H #define MYSQLCONNECTION_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kexidb/connection.h> #include "mysqlcursor.h" -#include <qdict.h> +#include <tqdict.h> namespace KexiDB { @@ -40,11 +40,12 @@ class MySqlConnectionInternal; class MySqlConnection : public Connection { Q_OBJECT + TQ_OBJECT public: virtual ~MySqlConnection(); - virtual Cursor* prepareQuery( const QString& statement = QString::null, uint cursor_options = 0 ); + virtual Cursor* prepareQuery( const TQString& statement = TQString(), uint cursor_options = 0 ); virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 ); virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type, @@ -57,24 +58,24 @@ class MySqlConnection : public Connection virtual bool drv_connect(KexiDB::ServerVersionInfo& version); virtual bool drv_disconnect(); - virtual bool drv_getDatabasesList( QStringList &list ); - virtual bool drv_createDatabase( const QString &dbName = QString::null ); - virtual bool drv_useDatabase( const QString &dbName = QString::null, bool *cancelled = 0, + virtual bool drv_getDatabasesList( TQStringList &list ); + virtual bool drv_createDatabase( const TQString &dbName = TQString() ); + virtual bool drv_useDatabase( const TQString &dbName = TQString(), bool *cancelled = 0, MessageHandler* msgHandler = 0 ); virtual bool drv_closeDatabase(); - virtual bool drv_dropDatabase( const QString &dbName = QString::null ); - virtual bool drv_executeSQL( const QString& statement ); - virtual Q_ULLONG drv_lastInsertRowID(); + virtual bool drv_dropDatabase( const TQString &dbName = TQString() ); + virtual bool drv_executeSQL( const TQString& statement ); + virtual TQ_ULLONG drv_lastInsertRowID(); virtual int serverResult(); - virtual QString serverResultName(); - virtual QString serverErrorMsg(); + virtual TQString serverResultName(); + virtual TQString serverErrorMsg(); virtual void drv_clearServerResult(); //TODO: move this somewhere to low level class (MIGRATION?) - virtual bool drv_getTablesList( QStringList &list ); + virtual bool drv_getTablesList( TQStringList &list ); //TODO: move this somewhere to low level class (MIGRATION?) - virtual bool drv_containsTable( const QString &tableName ); + virtual bool drv_containsTable( const TQString &tableName ); MySqlConnectionInternal* d; diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp index 9797ca96..50b94ae2 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.cpp @@ -18,10 +18,10 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#include <qcstring.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qfile.h> +#include <tqcstring.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqfile.h> #include <kdebug.h> @@ -67,37 +67,37 @@ void MySqlConnectionInternal::storeResult() none is specified). If the server is on a remote machine, then a port is the port that the remote server is listening on. */ -//bool MySqlConnectionInternal::db_connect(QCString host, QCString user, -// QCString password, unsigned short int port, QString socket) +//bool MySqlConnectionInternal::db_connect(TQCString host, TQCString user, +// TQCString password, unsigned short int port, TQString socket) bool MySqlConnectionInternal::db_connect(const KexiDB::ConnectionData& data) { if (!(mysql = mysql_init(mysql))) return false; KexiDBDrvDbg << "MySqlConnectionInternal::connect()" << endl; - QCString localSocket; - QString hostName = data.hostName; + TQCString localSocket; + TQString hostName = data.hostName; if (hostName.isEmpty() || hostName.lower()=="localhost") { if (data.useLocalSocketFile) { if (data.localSocketFileName.isEmpty()) { //! @todo move the list of default sockets to a generic method - QStringList sockets; - #ifndef Q_WS_WIN + TQStringList sockets; + #ifndef TQ_WS_WIN sockets.append("/var/lib/mysql/mysql.sock"); sockets.append("/var/run/mysqld/mysqld.sock"); sockets.append("/tmp/mysql.sock"); - for(QStringList::ConstIterator it = sockets.constBegin(); it != sockets.constEnd(); it++) + for(TQStringList::ConstIterator it = sockets.constBegin(); it != sockets.constEnd(); it++) { - if(QFile(*it).exists()) { - localSocket = ((QString)(*it)).local8Bit(); + if(TQFile(*it).exists()) { + localSocket = ((TQString)(*it)).local8Bit(); break; } } #endif } else - localSocket = QFile::encodeName(data.localSocketFileName); + localSocket = TQFile::encodeName(data.localSocketFileName); } else { //we're not using local socket @@ -131,17 +131,17 @@ bool MySqlConnectionInternal::db_disconnect() /* ************************************************************************** */ /*! Selects dbName as the active database so it can be used. */ -bool MySqlConnectionInternal::useDatabase(const QString &dbName) { +bool MySqlConnectionInternal::useDatabase(const TQString &dbName) { //TODO is here escaping needed? return executeSQL("USE " + dbName); } /*! Executes the given SQL statement on the server. */ -bool MySqlConnectionInternal::executeSQL(const QString& statement) { +bool MySqlConnectionInternal::executeSQL(const TQString& statement) { // KexiDBDrvDbg << "MySqlConnectionInternal::executeSQL: " // << statement << endl; - QCString queryStr=statement.utf8(); + TQCString queryStr=statement.utf8(); const char *query=queryStr; if(mysql_real_query(mysql, query, strlen(query)) == 0) { @@ -153,8 +153,8 @@ bool MySqlConnectionInternal::executeSQL(const QString& statement) { return false; } -QString MySqlConnectionInternal::escapeIdentifier(const QString& str) const { - return QString(str).replace('`', "'"); +TQString MySqlConnectionInternal::escapeIdentifier(const TQString& str) const { + return TQString(str).tqreplace('`', "'"); } //-------------------------------------- diff --git a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h index 5bb77487..85d8c57b 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h +++ b/kexi/kexidb/drivers/mySQL/mysqlconnection_p.h @@ -22,7 +22,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, #include <kexidb/connection_p.h> -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN #include <my_global.h> #endif #include <mysql_version.h> @@ -31,8 +31,8 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, typedef struct st_mysql MYSQL; #undef bool -class QCString; -class QString; +class TQCString; +class TQString; #ifdef MYSQLMIGRATE_H #define NAMESPACE KexiMigration @@ -64,20 +64,20 @@ class MySqlConnectionInternal : public KexiDB::ConnectionInternal bool db_disconnect(); //! Selects a database that is about to be used - bool useDatabase(const QString &dbName = QString::null); + bool useDatabase(const TQString &dbName = TQString()); //! Execute SQL statement on the database - bool executeSQL( const QString& statement ); + bool executeSQL( const TQString& statement ); //! Stores last operation's result virtual void storeResult(); //! Escapes a table, database or column name - QString escapeIdentifier(const QString& str) const; + TQString escapeIdentifier(const TQString& str) const; MYSQL *mysql; bool mysql_owned; //!< true if mysql pointer should be freed on destruction - QString errmsg; //!< server-specific message of last operation + TQString errmsg; //!< server-specific message of last operation int res; //!< result code of last operation on server }; diff --git a/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp b/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp index 7897fa97..abfdb44f 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqlcursor.cpp @@ -31,7 +31,7 @@ using namespace KexiDB; -MySqlCursor::MySqlCursor(KexiDB::Connection* conn, const QString& statement, uint cursor_options) +MySqlCursor::MySqlCursor(KexiDB::Connection* conn, const TQString& statement, uint cursor_options) : Cursor(conn,statement,cursor_options) , d( new MySqlCursorData(conn) ) { @@ -72,7 +72,7 @@ bool MySqlCursor::drv_open() { } } - setError(ERR_DB_SPECIFIC,QString::fromUtf8(mysql_error(d->mysql))); + setError(ERR_DB_SPECIFIC,TQString::fromUtf8(mysql_error(d->mysql))); return false; } @@ -106,9 +106,9 @@ void MySqlCursor::drv_getNextRecord() { } // This isn't going to work right now as it uses d->mysqlrow -QVariant MySqlCursor::value(uint pos) { +TQVariant MySqlCursor::value(uint pos) { if (!d->mysqlrow || pos>=m_fieldCount || d->mysqlrow[pos]==0) - return QVariant(); + return TQVariant(); KexiDB::Field *f = (m_fieldsExpanded && pos<m_fieldsExpanded->count()) ? m_fieldsExpanded->at(pos)->field : 0; @@ -119,20 +119,20 @@ QVariant MySqlCursor::value(uint pos) { /* moved to cstringToVariant() //from most to least frequently used types: if (!f || f->isTextType()) - return QVariant( QString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]) ); + return TQVariant( TQString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]) ); else if (f->isIntegerType()) //! @todo support BigInteger - return QVariant( QCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toInt() ); + return TQVariant( TQCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toInt() ); else if (f->isFPNumericType()) - return QVariant( QCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toDouble() ); + return TQVariant( TQCString((const char*)d->mysqlrow[pos], d->lengths[pos]).toDouble() ); //default - return QVariant(QString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]));*/ + return TQVariant(TQString::fromUtf8((const char*)d->mysqlrow[pos], d->lengths[pos]));*/ } /* As with sqlite, the DB library returns all values (including numbers) as - strings. So just put that string in a QVariant and let KexiDB deal with it. + strings. So just put that string in a TQVariant and let KexiDB deal with it. */ void MySqlCursor::storeCurrentRow(RowData &data) const { @@ -145,7 +145,7 @@ void MySqlCursor::storeCurrentRow(RowData &data) const data.resize(m_fieldCount); const uint fieldsExpandedCount = m_fieldsExpanded ? m_fieldsExpanded->count() : UINT_MAX; - const uint realCount = QMIN(fieldsExpandedCount, m_fieldCount); + const uint realCount = TQMIN(fieldsExpandedCount, m_fieldCount); for( uint i=0; i<realCount; i++) { Field *f = m_fieldsExpanded ? m_fieldsExpanded->at(i)->field : 0; if (m_fieldsExpanded && !f) @@ -153,7 +153,7 @@ void MySqlCursor::storeCurrentRow(RowData &data) const data[i] = KexiDB::cstringToVariant(d->mysqlrow[i], f, d->lengths[i]); /* moved to cstringToVariant() if (f && f->type()==Field::BLOB) { - QByteArray ba; + TQByteArray ba; ba.duplicate(d->mysqlrow[i], d->lengths[i]); data[i] = ba; KexiDBDbg << data[i].toByteArray().size() << endl; @@ -161,7 +161,7 @@ void MySqlCursor::storeCurrentRow(RowData &data) const //! @todo more types! //! @todo look at what type mysql declares! else { - data[i] = QVariant(QString::fromUtf8((const char*)d->mysqlrow[i], d->lengths[i])); + data[i] = TQVariant(TQString::fromUtf8((const char*)d->mysqlrow[i], d->lengths[i])); }*/ } } @@ -183,7 +183,7 @@ void MySqlCursor::drv_bufferMovePointerPrev() { } -void MySqlCursor::drv_bufferMovePointerTo(Q_LLONG to) { +void MySqlCursor::drv_bufferMovePointerTo(TQ_LLONG to) { //MYSQL_ROW_OFFSET ro=mysql_row_tell(d->mysqlres); mysql_data_seek(d->mysqlres, to); d->mysqlrow=mysql_fetch_row(d->mysqlres); @@ -200,9 +200,9 @@ int MySqlCursor::serverResult() return d->res; } -QString MySqlCursor::serverResultName() +TQString MySqlCursor::serverResultName() { - return QString::null; + return TQString(); } void MySqlCursor::drv_clearServerResult() @@ -212,7 +212,7 @@ void MySqlCursor::drv_clearServerResult() d->res = 0; } -QString MySqlCursor::serverErrorMsg() +TQString MySqlCursor::serverErrorMsg() { return d->errmsg; } diff --git a/kexi/kexidb/drivers/mySQL/mysqlcursor.h b/kexi/kexidb/drivers/mySQL/mysqlcursor.h index 09ace22b..4f48d602 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlcursor.h +++ b/kexi/kexidb/drivers/mySQL/mysqlcursor.h @@ -29,7 +29,7 @@ class MySqlCursorData; class MySqlCursor: public Cursor { public: - MySqlCursor(Connection* conn, const QString& statement = QString::null, uint cursor_options = NoOptions ); + MySqlCursor(Connection* conn, const TQString& statement = TQString(), uint cursor_options = NoOptions ); MySqlCursor(Connection* conn, QuerySchema& query, uint options = NoOptions ); virtual ~MySqlCursor(); virtual bool drv_open(); @@ -37,23 +37,23 @@ public: // virtual bool drv_moveFirst(); virtual void drv_getNextRecord(); //virtual bool drv_getPrevRecord(); - virtual QVariant value(uint); + virtual TQVariant value(uint); virtual void drv_clearServerResult(); virtual void drv_appendCurrentRecordToBuffer(); virtual void drv_bufferMovePointerNext(); virtual void drv_bufferMovePointerPrev(); - virtual void drv_bufferMovePointerTo(Q_LLONG to); + virtual void drv_bufferMovePointerTo(TQ_LLONG to); virtual const char** rowData() const; virtual void storeCurrentRow(RowData &data) const; // virtual bool save(RowData& data, RowEditBuffer& buf); virtual int serverResult(); - virtual QString serverResultName(); - virtual QString serverErrorMsg(); + virtual TQString serverResultName(); + virtual TQString serverErrorMsg(); protected: - QVariant pValue(uint pos) const; + TQVariant pValue(uint pos) const; // MYSQL_RES *m_res; // MYSQL_ROW m_row; // MYSQL *my_conn; diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp index c27681c0..9a1213b0 100644 --- a/kexi/kexidb/drivers/mySQL/mysqldriver.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqldriver.cpp @@ -19,16 +19,16 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */ -#ifdef Q_WS_WIN +#ifdef TQ_WS_WIN # include <mysql/config-win.h> #endif #include <mysql_version.h> #include <mysql.h> #define BOOL bool -#include <qvariant.h> -#include <qfile.h> -#include <qdict.h> +#include <tqvariant.h> +#include <tqfile.h> +#include <tqdict.h> #include <kgenericfactory.h> #include <kdebug.h> @@ -54,7 +54,7 @@ KEXIDB_DRIVER_INFO( MySqlDriver, mysql ) * * See: http://dev.mysql.com/doc/mysql/en/Column_types.html */ -MySqlDriver::MySqlDriver(QObject *parent, const char *name, const QStringList &args) : Driver(parent, name,args) +MySqlDriver::MySqlDriver(TQObject *tqparent, const char *name, const TQStringList &args) : Driver(tqparent, name,args) { // KexiDBDrvDbg << "MySqlDriver::MySqlDriver()" << endl; @@ -63,9 +63,9 @@ MySqlDriver::MySqlDriver(QObject *parent, const char *name, const QStringList &a beh->ROW_ID_FIELD_NAME="LAST_INSERT_ID()"; beh->ROW_ID_FIELD_RETURNS_LAST_AUTOINCREMENTED_VALUE=true; - beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false; - beh->USING_DATABASE_REQUIRED_TO_CONNECT=false; - beh->QUOTATION_MARKS_FOR_IDENTIFIER='`'; + beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=false; + beh->USING_DATABASE_RETQUIRED_TO_CONNECT=false; + beh->TQUOTATION_MARKS_FOR_IDENTIFIER='`'; beh->SQL_KEYWORDS = keywords; initSQLKeywords(331); @@ -103,16 +103,16 @@ MySqlDriver::drv_createConnection( ConnectionData &conn_data ) return new MySqlConnection( this, conn_data ); } -bool MySqlDriver::isSystemDatabaseName(const QString &n) const +bool MySqlDriver::isSystemDatabaseName(const TQString &n) const { return n.lower()=="mysql" || Driver::isSystemObjectName(n); } -bool MySqlDriver::drv_isSystemFieldName(const QString&) const { +bool MySqlDriver::drv_isSystemFieldName(const TQString&) const { return false; } -QString MySqlDriver::escapeString(const QString& str) const +TQString MySqlDriver::escapeString(const TQString& str) const { //escape as in http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html //! @todo support more characters, like %, _ @@ -120,20 +120,20 @@ QString MySqlDriver::escapeString(const QString& str) const const int old_length = str.length(); int i; for ( i = 0; i < old_length; i++ ) { //anything to escape? - const unsigned int ch = str[i].unicode(); + const unsigned int ch = str[i].tqunicode(); if (ch == '\\' || ch == '\'' || ch == '"' || ch == '\n' || ch == '\r' || ch == '\t' || ch == '\b' || ch == '\0') break; } if (i >= old_length) { //no characters to escape - return QString::fromLatin1("'") + str + QString::fromLatin1("'"); + return TQString::tqfromLatin1("'") + str + TQString::tqfromLatin1("'"); } - QChar *new_string = new QChar[ old_length * 3 + 1 ]; // a worst case approximation + TQChar *new_string = new TQChar[ old_length * 3 + 1 ]; // a worst case approximation //! @todo move new_string to Driver::m_new_string or so... int new_length = 0; new_string[new_length++] = '\''; //prepend ' for ( i = 0; i < old_length; i++, new_length++ ) { - const unsigned int ch = str[i].unicode(); + const unsigned int ch = str[i].tqunicode(); if (ch == '\\') { new_string[new_length++] = '\\'; new_string[new_length] = '\\'; @@ -175,37 +175,37 @@ QString MySqlDriver::escapeString(const QString& str) const } new_string[new_length++] = '\''; //append ' - QString result(new_string, new_length); + TQString result(new_string, new_length); delete [] new_string; return result; } -QString MySqlDriver::escapeBLOB(const QByteArray& array) const +TQString MySqlDriver::escapeBLOB(const TQByteArray& array) const { return KexiDB::escapeBLOB(array, KexiDB::BLOBEscape0xHex); } -QCString MySqlDriver::escapeString(const QCString& str) const +TQCString MySqlDriver::escapeString(const TQCString& str) const { //! @todo optimize using mysql_real_escape_string()? //! see http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html - return QCString("'")+QCString(str) - .replace( '\\', "\\\\" ) - .replace( '\'', "\\''" ) - .replace( '"', "\\\"" ) - + QCString("'"); + return TQCString("'")+TQCString(str) + .tqreplace( '\\', "\\\\" ) + .tqreplace( '\'', "\\''" ) + .tqreplace( '"', "\\\"" ) + + TQCString("'"); } /*! Add back-ticks to an identifier, and replace any back-ticks within * the name with single quotes. */ -QString MySqlDriver::drv_escapeIdentifier( const QString& str) const { - return QString(str).replace('`', "'"); +TQString MySqlDriver::drv_escapeIdentifier( const TQString& str) const { + return TQString(str).tqreplace('`', "'"); } -QCString MySqlDriver::drv_escapeIdentifier( const QCString& str) const { - return QCString(str).replace('`', "'"); +TQCString MySqlDriver::drv_escapeIdentifier( const TQCString& str) const { + return TQCString(str).tqreplace('`', "'"); } #include "mysqldriver.moc" diff --git a/kexi/kexidb/drivers/mySQL/mysqldriver.h b/kexi/kexidb/drivers/mySQL/mysqldriver.h index 8282e215..7e6d5a35 100644 --- a/kexi/kexidb/drivers/mySQL/mysqldriver.h +++ b/kexi/kexidb/drivers/mySQL/mysqldriver.h @@ -30,26 +30,27 @@ namespace KexiDB { class MySqlDriver : public Driver { Q_OBJECT + TQ_OBJECT KEXIDB_DRIVER public: - MySqlDriver(QObject *parent, const char *name, const QStringList &args=QStringList()); + MySqlDriver(TQObject *tqparent, const char *name, const TQStringList &args=TQStringList()); virtual ~MySqlDriver(); - virtual bool isSystemDatabaseName( const QString &n ) const; + virtual bool isSystemDatabaseName( const TQString &n ) const; //! Escape a string for use as a value - virtual QString escapeString(const QString& str) const; - virtual QCString escapeString(const QCString& str) const; + virtual TQString escapeString(const TQString& str) const; + virtual TQCString escapeString(const TQCString& str) const; //! Escape BLOB value \a array - virtual QString escapeBLOB(const QByteArray& array) const; + virtual TQString escapeBLOB(const TQByteArray& array) const; protected: - virtual QString drv_escapeIdentifier( const QString& str) const; - virtual QCString drv_escapeIdentifier( const QCString& str) const; + virtual TQString drv_escapeIdentifier( const TQString& str) const; + virtual TQCString drv_escapeIdentifier( const TQCString& str) const; virtual Connection *drv_createConnection( ConnectionData &conn_data ); - virtual bool drv_isSystemFieldName( const QString& n ) const; + virtual bool drv_isSystemFieldName( const TQString& n ) const; private: static const char *keywords[]; diff --git a/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp b/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp index e06adb5e..89dd8d77 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqlkeywords.cpp @@ -177,7 +177,7 @@ namespace KexiDB { "MASTER_SSL_KEY", "MASTER_USER", "MAX_CONNECTIONS_PER_HOUR", - "MAX_QUERIES_PER_HOUR", + "MAX_TQUERIES_PER_HOUR", "MAX_ROWS", "MAX_UPDATES_PER_HOUR", "MEDIUM", @@ -229,8 +229,8 @@ namespace KexiDB { "PROCESS", "PROCESSLIST", "PURGE", - "QUERY", - "QUICK", + "TQUERY", + "TQUICK", "RAID0", "RAID_CHUNKS", "RAID_CHUNKSIZE", @@ -246,7 +246,7 @@ namespace KexiDB { "REPAIR", "REPEATABLE", "REPLICATION", - "REQUIRE", + "RETQUIRE", "RESET", "RESTORE", "RETURNS", diff --git a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp index 2702626a..7b245d9a 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp +++ b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.cpp @@ -143,7 +143,7 @@ bool MySqlPreparedStatement::execute() else assert(0); //impl. error - for (QValueListConstIterator<QVariant> it = m_args.constBegin(); + for (TQValueListConstIterator<TQVariant> it = m_args.constBegin(); (field = itFields.current()) && arg < m_realParamCount; ++it, ++itFields, arg++) { if (it==m_args.constEnd() || (*it).isNull()) {//no value to bind or the value is null: bind NULL @@ -201,7 +201,7 @@ m_stringBuffer[ 1024 ]; ??? { //! @todo what about unsigned > LLONG_MAX ? bool ok; - Q_LLONG value = (*it).toLongLong(&ok); + TQ_LLONG value = (*it).toLongLong(&ok); if (ok) { res = sqlite3_bind_int64(prepared_st_handle, arg, value); if (SQLITE_OK != res) { @@ -220,7 +220,7 @@ m_stringBuffer[ 1024 ]; ??? } case KexiDB::Field::Boolean: res = sqlite3_bind_text(prepared_st_handle, arg, - QString::number((*it).toBool() ? 1 : 0).latin1(), + TQString::number((*it).toBool() ? 1 : 0).latin1(), 1, SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { //! @todo msg? @@ -256,7 +256,7 @@ m_stringBuffer[ 1024 ]; ??? break; case KexiDB::Field::BLOB: { - const QByteArray byteArray((*it).toByteArray()); + const TQByteArray byteArray((*it).toByteArray()); res = sqlite3_bind_blob(prepared_st_handle, arg, (const char*)byteArray, byteArray.size(), SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { diff --git a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h index 01478e9e..14601a8b 100644 --- a/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h +++ b/kexi/kexidb/drivers/mySQL/mysqlpreparedstatement.h @@ -39,7 +39,7 @@ class MySqlPreparedStatement : public PreparedStatement, public MySqlConnectionI virtual bool execute(); - QCString m_tempStatementString; + TQCString m_tempStatementString; #ifdef KEXI_USE_MYSQL_STMT int m_realParamCount; diff --git a/kexi/kexidb/drivers/odbc/odbcconnection.cpp b/kexi/kexidb/drivers/odbc/odbcconnection.cpp index ec5a7cdf..3ac6f082 100644 --- a/kexi/kexidb/drivers/odbc/odbcconnection.cpp +++ b/kexi/kexidb/drivers/odbc/odbcconnection.cpp @@ -23,8 +23,8 @@ #include <sqltypes.h> //QT Includes -#include <qfile.h> -#include <qdir.h> +#include <tqfile.h> +#include <tqdir.h> //KDE Includes #include <kgenericfactory.h> @@ -45,7 +45,7 @@ class ODBCConnectionPrivate { public: ConnectionData connData; - QString currentDB; + TQString currentDB; SQLHENV envHandle; SQLHDBC connectionHandle; }; @@ -57,19 +57,19 @@ ODBCConnection::ODBCConnection( Driver *driver, ConnectionData &conn_data ) //d->connData = conn_data; } -Cursor* ODBCConnection::prepareQuery(const QString& statement, uint cursor_options) +Cursor* ODBCConnection::prepareQuery(const TQString& statement, uint cursor_options) { Q_UNUSED( statement ); Q_UNUSED( cursor_options ); return 0; } -QString ODBCConnection::escapeString(const QString& str) const +TQString ODBCConnection::escapeString(const TQString& str) const { return str; } -QCString ODBCConnection::escapeString(const QCString& str) const +TQCString ODBCConnection::escapeString(const TQCString& str) const { return str; } @@ -112,17 +112,17 @@ bool ODBCConnection::drv_disconnect() return true; } -bool ODBCConnection::drv_getDatabasesList(QStringList &) +bool ODBCConnection::drv_getDatabasesList(TQStringList &) { return false; } -bool ODBCConnection::drv_createDatabase(const QString &) +bool ODBCConnection::drv_createDatabase(const TQString &) { return false; } -bool ODBCConnection::drv_useDatabase(const QString &) +bool ODBCConnection::drv_useDatabase(const TQString &) { return false; } @@ -132,12 +132,12 @@ bool ODBCConnection::drv_closeDatabase() return false; } -bool ODBCConnection::drv_dropDatabase(const QString &) +bool ODBCConnection::drv_dropDatabase(const TQString &) { return false; } -bool ODBCConnection::drv_executeSQL(const QString &) +bool ODBCConnection::drv_executeSQL(const TQString &) { return false; } diff --git a/kexi/kexidb/drivers/odbc/odbcconnection.h b/kexi/kexidb/drivers/odbc/odbcconnection.h index 8f551905..128eab61 100644 --- a/kexi/kexidb/drivers/odbc/odbcconnection.h +++ b/kexi/kexidb/drivers/odbc/odbcconnection.h @@ -20,7 +20,7 @@ #ifndef KEXIDB_CONN_ODBC_H #define KEXIDB_CONN_ODBC_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kexidb/connection.h> #include <kexidb/tableschema.h> @@ -39,13 +39,14 @@ class Driver; class ODBCConnection : public Connection { Q_OBJECT + TQ_OBJECT public: ~ODBCConnection(); - virtual Cursor* prepareQuery( const QString& statement = QString::null, uint cursor_options = 0 ); - virtual QString escapeString(const QString& str) const; - virtual QCString escapeString(const QCString& str) const; + virtual Cursor* prepareQuery( const TQString& statement = TQString(), uint cursor_options = 0 ); + virtual TQString escapeString(const TQString& str) const; + virtual TQCString escapeString(const TQCString& str) const; protected: /*! Used by driver */ @@ -55,29 +56,29 @@ class ODBCConnection : public Connection virtual bool drv_disconnect(); - virtual bool drv_getDatabasesList( QStringList &list ); + virtual bool drv_getDatabasesList( TQStringList &list ); /*! Creates new database using connection. Note: Do not pass \a dbName arg because for file-based engine (that has one database per connection) it is defined during connection. */ - virtual bool drv_createDatabase( const QString &dbName = QString::null ); + virtual bool drv_createDatabase( const TQString &dbName = TQString() ); /*! Opens existing database using connection. Do not pass \a dbName arg because for file-based engine (that has one database per connection) it is defined during connection. If you pass it, database file name will be changed. */ - virtual bool drv_useDatabase( const QString &dbName = QString::null ); + virtual bool drv_useDatabase( const TQString &dbName = TQString() ); virtual bool drv_closeDatabase(); /*! Drops database from the server using connection. After drop, database shouldn't be accessible anymore, so database file is just removed. See note from drv_useDatabase(). */ - virtual bool drv_dropDatabase( const QString &dbName = QString::null ); + virtual bool drv_dropDatabase( const TQString &dbName = TQString() ); //virtual bool drv_createTable( const KexiDB::Table& table ); - virtual bool drv_executeSQL( const QString& statement ); + virtual bool drv_executeSQL( const TQString& statement ); friend class ODBCDriver; diff --git a/kexi/kexidb/drivers/odbc/odbcdriver.cpp b/kexi/kexidb/drivers/odbc/odbcdriver.cpp index aac6a6c9..38e0796e 100644 --- a/kexi/kexidb/drivers/odbc/odbcdriver.cpp +++ b/kexi/kexidb/drivers/odbc/odbcdriver.cpp @@ -18,10 +18,10 @@ */ //QT Includes -#include <qfile.h> -#include <qdir.h> -#include <qstring.h> -#include <qcstring.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqstring.h> +#include <tqcstring.h> //KDE Includes #include <kdebug.h> @@ -39,8 +39,8 @@ using namespace KexiDB; KEXIDB_DRIVER_INFO( ODBCDriver, odbc ) -ODBCDriver::ODBCDriver( QObject *parent, const char *name, const QStringList &args ) - : Driver( parent, name, args ) +ODBCDriver::ODBCDriver( TQObject *tqparent, const char *name, const TQStringList &args ) + : Driver( tqparent, name, args ) { d->isFileDriver = false; d->isDBOpenedAfterCreate = true; @@ -76,30 +76,30 @@ KexiDB::Connection* ODBCDriver::drv_createConnection( ConnectionData &conn_data //return new ODBCConnection( this, conn_data ); } -bool ODBCDriver::isSystemDatabaseName( const QString& name ) const +bool ODBCDriver::isSystemDatabaseName( const TQString& name ) const { Q_UNUSED( name ); return false; } -bool ODBCDriver::isSystemObjectName( const QString& name ) +bool ODBCDriver::isSystemObjectName( const TQString& name ) { Q_UNUSED( name ); return false; } -bool ODBCDriver::isSystemFieldName( const QString& name ) const +bool ODBCDriver::isSystemFieldName( const TQString& name ) const { Q_UNUSED( name ); return false; } -QString ODBCDriver::escapeString( const QString& str ) const +TQString ODBCDriver::escapeString( const TQString& str ) const { return str; } -QCString ODBCDriver::escapeString( const QCString& str ) const +TQCString ODBCDriver::escapeString( const TQCString& str ) const { return str; } diff --git a/kexi/kexidb/drivers/odbc/odbcdriver.h b/kexi/kexidb/drivers/odbc/odbcdriver.h index 60681f21..c26af43f 100644 --- a/kexi/kexidb/drivers/odbc/odbcdriver.h +++ b/kexi/kexidb/drivers/odbc/odbcdriver.h @@ -23,8 +23,8 @@ //Kexi Includes #include <kexidb/driver.h> -class QCString; -class QString; +class TQCString; +class TQString; namespace KexiDB { @@ -41,27 +41,28 @@ class ODBCDriverPrivate; class ODBCDriver : public Driver { Q_OBJECT + TQ_OBJECT KEXIDB_DRIVER public: - ODBCDriver( QObject *parent, const char *name, const QStringList &args = QStringList() ); + ODBCDriver( TQObject *tqparent, const char *name, const TQStringList &args = TQStringList() ); ~ODBCDriver(); - virtual bool isSystemDatabaseName( const QString& name ) const; + virtual bool isSystemDatabaseName( const TQString& name ) const; /** \return true if n is a system object name; * \todo Find out what is a system object name and what isn't */ - virtual bool isSystemObjectName( const QString& name ); + virtual bool isSystemObjectName( const TQString& name ); /** * \return true if \a n is a system field name; * There aren't any system fields per tables, unless the table * is a system table */ - virtual bool isSystemFieldName( const QString& name ) const; + virtual bool isSystemFieldName( const TQString& name ) const; - virtual QString escapeString( const QString& str ) const; - virtual QCString escapeString( const QCString& str ) const; + virtual TQString escapeString( const TQString& str ) const; + virtual TQCString escapeString( const TQCString& str ) const; protected: virtual Connection *drv_createConnection( ConnectionData &conn_data ); diff --git a/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp b/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp index 8465bcf4..c81f04ad 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp +++ b/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp @@ -18,8 +18,8 @@ */ #include "pqxxconnection.h" -#include <qvariant.h> -#include <qfile.h> +#include <tqvariant.h> +#include <tqfile.h> #include <kdebug.h> #include <kexidb/error.h> #include <kexidb/global.h> @@ -70,7 +70,7 @@ pqxxSqlConnection::~pqxxSqlConnection() //================================================================================== //Return a new query based on a query statment -Cursor* pqxxSqlConnection::prepareQuery( const QString& statement, uint cursor_options) +Cursor* pqxxSqlConnection::prepareQuery( const TQString& statement, uint cursor_options) { Q_UNUSED(cursor_options); return new pqxxSqlCursor(this, statement, 1); //Always used buffered cursor @@ -86,9 +86,9 @@ Cursor* pqxxSqlConnection::prepareQuery( QuerySchema& query, uint cursor_options //================================================================================== //Properly escaped a database object name -QString pqxxSqlConnection::escapeName(const QString &name) const +TQString pqxxSqlConnection::escapeName(const TQString &name) const { - return QString("\"" + name + "\""); + return TQString("\"" + name + "\""); } //================================================================================== @@ -116,7 +116,7 @@ bool pqxxSqlConnection::drv_disconnect() //================================================================================== //Return a list of database names -bool pqxxSqlConnection::drv_getDatabasesList( QStringList &list ) +bool pqxxSqlConnection::drv_getDatabasesList( TQStringList &list ) { // KexiDBDrvDbg << "pqxxSqlConnection::drv_getDatabaseList" << endl; @@ -128,7 +128,7 @@ bool pqxxSqlConnection::drv_getDatabasesList( QStringList &list ) // Read value of column 0 into a string N c[0].to(N); // Copy the result into the return list - list << QString::fromLatin1 (N.c_str()); + list << TQString::tqfromLatin1 (N.c_str()); } return true; } @@ -138,7 +138,7 @@ bool pqxxSqlConnection::drv_getDatabasesList( QStringList &list ) //================================================================================== //Create a new database -bool pqxxSqlConnection::drv_createDatabase( const QString &dbName ) +bool pqxxSqlConnection::drv_createDatabase( const TQString &dbName ) { KexiDBDrvDbg << "pqxxSqlConnection::drv_createDatabase: " << dbName << endl; @@ -150,16 +150,16 @@ bool pqxxSqlConnection::drv_createDatabase( const QString &dbName ) //================================================================================== //Use this as our connection instead of connect -bool pqxxSqlConnection::drv_useDatabase( const QString &dbName, bool *cancelled, +bool pqxxSqlConnection::drv_useDatabase( const TQString &dbName, bool *cancelled, MessageHandler* msgHandler ) { Q_UNUSED(cancelled); Q_UNUSED(msgHandler); KexiDBDrvDbg << "pqxxSqlConnection::drv_useDatabase: " << dbName << endl; - QString conninfo; - QString socket; - QStringList sockets; + TQString conninfo; + TQString socket; + TQStringList sockets; if (data()->hostName.isEmpty() || data()->hostName == "localhost") { @@ -167,9 +167,9 @@ bool pqxxSqlConnection::drv_useDatabase( const QString &dbName, bool *cancelled, { sockets.append("/tmp/.s.PGSQL.5432"); - for(QStringList::ConstIterator it = sockets.constBegin(); it != sockets.constEnd(); it++) + for(TQStringList::ConstIterator it = sockets.constBegin(); it != sockets.constEnd(); it++) { - if(QFile(*it).exists()) + if(TQFile(*it).exists()) { socket = (*it); break; @@ -190,15 +190,15 @@ bool pqxxSqlConnection::drv_useDatabase( const QString &dbName, bool *cancelled, if (data()->port == 0) data()->port = 5432; - conninfo += QString::fromLatin1(" port='%1'").arg(data()->port); + conninfo += TQString::tqfromLatin1(" port='%1'").tqarg(data()->port); - conninfo += QString::fromLatin1(" dbname='%1'").arg(dbName); + conninfo += TQString::tqfromLatin1(" dbname='%1'").tqarg(dbName); if (!data()->userName.isNull()) - conninfo += QString::fromLatin1(" user='%1'").arg(data()->userName); + conninfo += TQString::tqfromLatin1(" user='%1'").tqarg(data()->userName); if (!data()->password.isNull()) - conninfo += QString::fromLatin1(" password='%1'").arg(data()->password); + conninfo += TQString::tqfromLatin1(" password='%1'").tqarg(data()->password); try { @@ -213,7 +213,7 @@ bool pqxxSqlConnection::drv_useDatabase( const QString &dbName, bool *cancelled, catch(const std::exception &e) { KexiDBDrvDbg << "pqxxSqlConnection::drv_useDatabase:exception - " << e.what() << endl; - d->errmsg = QString::fromUtf8( e.what() ); + d->errmsg = TQString::fromUtf8( e.what() ); } catch(...) @@ -244,7 +244,7 @@ bool pqxxSqlConnection::drv_closeDatabase() //================================================================================== //Drops the given database -bool pqxxSqlConnection::drv_dropDatabase( const QString &dbName ) +bool pqxxSqlConnection::drv_dropDatabase( const TQString &dbName ) { KexiDBDrvDbg << "pqxxSqlConnection::drv_dropDatabase: " << dbName << endl; @@ -257,7 +257,7 @@ bool pqxxSqlConnection::drv_dropDatabase( const QString &dbName ) //================================================================================== //Execute an SQL statement -bool pqxxSqlConnection::drv_executeSQL( const QString& statement ) +bool pqxxSqlConnection::drv_executeSQL( const TQString& statement ) { // KexiDBDrvDbg << "pqxxSqlConnection::drv_executeSQL: " << statement << endl; bool ok = false; @@ -299,7 +299,7 @@ bool pqxxSqlConnection::drv_executeSQL( const QString& statement ) catch (const std::exception &e) { //If an error ocurred then put the error description into _dbError - d->errmsg = QString::fromUtf8( e.what() ); + d->errmsg = TQString::fromUtf8( e.what() ); KexiDBDrvDbg << "pqxxSqlConnection::drv_executeSQL:exception - " << e.what() << endl; } catch(...) @@ -323,7 +323,7 @@ bool pqxxSqlConnection::drv_isDatabaseUsed() const //================================================================================== //Return the oid of the last insert - only works if sql was insert of 1 row -Q_ULLONG pqxxSqlConnection::drv_lastInsertRowID() +TQ_ULLONG pqxxSqlConnection::drv_lastInsertRowID() { if (d->res) { @@ -331,7 +331,7 @@ Q_ULLONG pqxxSqlConnection::drv_lastInsertRowID() if (theOid != pqxx::oid_none) { - return (Q_ULLONG)theOid; + return (TQ_ULLONG)theOid; } else { @@ -342,14 +342,14 @@ Q_ULLONG pqxxSqlConnection::drv_lastInsertRowID() } //<queries taken from pqxxMigrate> -bool pqxxSqlConnection::drv_containsTable( const QString &tableName ) +bool pqxxSqlConnection::drv_containsTable( const TQString &tableName ) { bool success; - return resultExists(QString("select 1 from pg_class where relkind='r' and relname LIKE %1") - .arg(driver()->escapeString(tableName)), success) && success; + return resultExists(TQString("select 1 from pg_class where relkind='r' and relname LIKE %1") + .tqarg(driver()->escapeString(tableName)), success) && success; } -bool pqxxSqlConnection::drv_getTablesList( QStringList &list ) +bool pqxxSqlConnection::drv_getTablesList( TQStringList &list ) { KexiDB::Cursor *cursor; m_sql = "select lower(relname) from pg_class where relkind='r'"; @@ -385,7 +385,7 @@ bool pqxxSqlConnection::drv_commitTransaction(TransactionData *tdata) catch (const std::exception &e) { //If an error ocurred then put the error description into _dbError - d->errmsg = QString::fromUtf8( e.what() ); + d->errmsg = TQString::fromUtf8( e.what() ); result = false; } catch (...) { @@ -407,7 +407,7 @@ bool pqxxSqlConnection::drv_rollbackTransaction(TransactionData *tdata) catch (const std::exception &e) { //If an error ocurred then put the error description into _dbError - d->errmsg = QString::fromUtf8( e.what() ); + d->errmsg = TQString::fromUtf8( e.what() ); result = false; } @@ -425,9 +425,9 @@ int pqxxSqlConnection::serverResult() return d->resultCode; } -QString pqxxSqlConnection::serverResultName() +TQString pqxxSqlConnection::serverResultName() { - return QString::null; + return TQString(); } void pqxxSqlConnection::drv_clearServerResult() @@ -435,7 +435,7 @@ void pqxxSqlConnection::drv_clearServerResult() d->resultCode = 0; } -QString pqxxSqlConnection::serverErrorMsg() +TQString pqxxSqlConnection::serverErrorMsg() { return d->errmsg; } diff --git a/kexi/kexidb/drivers/pqxx/pqxxconnection.h b/kexi/kexidb/drivers/pqxx/pqxxconnection.h index 85bed42a..7e7cdf69 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxconnection.h +++ b/kexi/kexidb/drivers/pqxx/pqxxconnection.h @@ -17,10 +17,10 @@ * Boston, MA 02110-1301, USA. */ -#ifndef PQXXCONNECTION_H -#define PQXXCONNECTION_H +#ifndef PTQXXCONNECTION_H +#define PTQXXCONNECTION_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kexidb/connection.h> #include "pqxxcursor.h" @@ -48,11 +48,12 @@ class pqxxTransactionData : public TransactionData class pqxxSqlConnection : public Connection { Q_OBJECT + TQ_OBJECT public: virtual ~pqxxSqlConnection(); - virtual Cursor* prepareQuery( const QString& statement = QString::null, uint cursor_options = 0 ); + virtual Cursor* prepareQuery( const TQString& statement = TQString(), uint cursor_options = 0 ); virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 ); virtual PreparedStatement::Ptr prepareStatement(PreparedStatement::StatementType type, FieldList& fields); @@ -63,19 +64,19 @@ class pqxxSqlConnection : public Connection virtual bool drv_isDatabaseUsed() const; virtual bool drv_connect(KexiDB::ServerVersionInfo& version); virtual bool drv_disconnect(); - virtual bool drv_getDatabasesList( QStringList &list ); - virtual bool drv_createDatabase( const QString &dbName = QString::null ); - virtual bool drv_useDatabase( const QString &dbName = QString::null, bool *cancelled = 0, + virtual bool drv_getDatabasesList( TQStringList &list ); + virtual bool drv_createDatabase( const TQString &dbName = TQString() ); + virtual bool drv_useDatabase( const TQString &dbName = TQString(), bool *cancelled = 0, MessageHandler* msgHandler = 0 ); virtual bool drv_closeDatabase(); - virtual bool drv_dropDatabase( const QString &dbName = QString::null ); - virtual bool drv_executeSQL( const QString& statement ); - virtual Q_ULLONG drv_lastInsertRowID(); + virtual bool drv_dropDatabase( const TQString &dbName = TQString() ); + virtual bool drv_executeSQL( const TQString& statement ); + virtual TQ_ULLONG drv_lastInsertRowID(); //TODO: move this somewhere to low level class (MIGRATION?) - virtual bool drv_getTablesList( QStringList &list ); + virtual bool drv_getTablesList( TQStringList &list ); //TODO: move this somewhere to low level class (MIGRATION?) - virtual bool drv_containsTable( const QString &tableName ); + virtual bool drv_containsTable( const TQString &tableName ); virtual TransactionData* drv_beginTransaction(); virtual bool drv_commitTransaction(TransactionData *); @@ -83,13 +84,13 @@ class pqxxSqlConnection : public Connection //Error reporting virtual int serverResult(); - virtual QString serverResultName(); + virtual TQString serverResultName(); virtual void drv_clearServerResult(); - virtual QString serverErrorMsg(); + virtual TQString serverErrorMsg(); pqxxSqlConnectionInternal *d; private: - QString escapeName(const QString &tn) const; + TQString escapeName(const TQString &tn) const; // pqxx::transaction_base* m_trans; //! temporary solution for executeSQL()... pqxxTransactionData *m_trans; diff --git a/kexi/kexidb/drivers/pqxx/pqxxconnection_p.h b/kexi/kexidb/drivers/pqxx/pqxxconnection_p.h index 0c78e583..2d33e410 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxconnection_p.h +++ b/kexi/kexidb/drivers/pqxx/pqxxconnection_p.h @@ -27,8 +27,8 @@ // Copyright: See COPYING file that comes with this distribution // // -#ifndef PQXXSQLCONNECTIONINTERNAL_H -#define PQXXSQLCONNECTIONINTERNAL_H +#ifndef PTQXXSQLCONNECTIONINTERNAL_H +#define PTQXXSQLCONNECTIONINTERNAL_H #include <kexidb/connection_p.h> #include <pqxx/pqxx> @@ -56,7 +56,7 @@ class pqxxSqlConnectionInternal : public ConnectionInternal KexiDB::ServerVersionInfo *version; //!< this is set in drv_connect(), so we can use it in drv_useDatabase() //!< because pgsql really connects after "USE". - QString errmsg; //!< server-specific message of last operation + TQString errmsg; //!< server-specific message of last operation int resultCode; //!< result code of last operation on server }; } diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp index 0004cf92..afcad047 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp +++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.cpp @@ -34,17 +34,17 @@ using namespace KexiDB; unsigned int pqxxSqlCursor_trans_num=0; //!< debug helper -static QByteArray pgsqlByteaToByteArray(const pqxx::result::field& r) +static TQByteArray pgsqlByteaToByteArray(const pqxx::result::field& r) { return KexiDB::pgsqlByteaToByteArray(r.c_str(), r.size()); } //================================================================================== //Constructor based on query statement -pqxxSqlCursor::pqxxSqlCursor(KexiDB::Connection* conn, const QString& statement, uint options): +pqxxSqlCursor::pqxxSqlCursor(KexiDB::Connection* conn, const TQString& statement, uint options): Cursor(conn,statement, options) { -// KexiDBDrvDbg << "PQXXSQLCURSOR: constructor for query statement" << endl; +// KexiDBDrvDbg << "PTQXXSQLCURSOR: constructor for query statement" << endl; my_conn = static_cast<pqxxSqlConnection*>(conn)->d->pqxxsql; m_options = Buffered; m_res = 0; @@ -57,7 +57,7 @@ pqxxSqlCursor::pqxxSqlCursor(KexiDB::Connection* conn, const QString& statement, pqxxSqlCursor::pqxxSqlCursor(Connection* conn, QuerySchema& query, uint options ) : Cursor( conn, query, options ) { -// KexiDBDrvDbg << "PQXXSQLCURSOR: constructor for query schema" << endl; +// KexiDBDrvDbg << "PTQXXSQLCURSOR: constructor for query schema" << endl; my_conn = static_cast<pqxxSqlConnection*>(conn)->d->pqxxsql; m_options = Buffered; m_res = 0; @@ -86,7 +86,7 @@ bool pqxxSqlCursor::drv_open() return false; } - QCString cur_name; + TQCString cur_name; //Set up a transaction try { @@ -117,8 +117,8 @@ bool pqxxSqlCursor::drv_open() } catch (const std::exception &e) { - setError(ERR_DB_SPECIFIC, QString::fromUtf8( e.what()) ); - KexiDBDrvWarn << "pqxxSqlCursor::drv_open:exception - " << QString::fromUtf8( e.what() ) << endl; + setError(ERR_DB_SPECIFIC, TQString::fromUtf8( e.what()) ); + KexiDBDrvWarn << "pqxxSqlCursor::drv_open:exception - " << TQString::fromUtf8( e.what() ) << endl; } catch(...) { @@ -193,31 +193,31 @@ void pqxxSqlCursor::drv_getPrevRecord() //================================================================================== //Return the value for a given column for the current record -QVariant pqxxSqlCursor::value(uint pos) +TQVariant pqxxSqlCursor::value(uint pos) { if (pos < m_fieldCount) return pValue(pos); else - return QVariant(); + return TQVariant(); } //================================================================================== //Return the value for a given column for the current record - Private const version -QVariant pqxxSqlCursor::pValue(uint pos)const +TQVariant pqxxSqlCursor::pValue(uint pos)const { if (m_res->size() <= 0) { KexiDBDrvWarn << "pqxxSqlCursor::value - ERROR: result size not greater than 0" << endl; - return QVariant(); + return TQVariant(); } if (pos>=(m_fieldCount+(m_containsROWIDInfo ? 1 : 0))) { // KexiDBDrvWarn << "pqxxSqlCursor::value - ERROR: requested position is greater than the number of fields" << endl; - return QVariant(); + return TQVariant(); } - KexiDB::Field *f = (m_fieldsExpanded && pos<QMIN(m_fieldsExpanded->count(), m_fieldCount)) + KexiDB::Field *f = (m_fieldsExpanded && pos<TQMIN(m_fieldsExpanded->count(), m_fieldCount)) ? m_fieldsExpanded->at(pos)->field : 0; // KexiDBDrvDbg << "pqxxSqlCursor::value(" << pos << ")" << endl; @@ -231,7 +231,7 @@ QVariant pqxxSqlCursor::pValue(uint pos)const } else if (f->isTextType()) { - return QString::fromUtf8((*m_res)[at()][pos].c_str()); //utf8? + return TQString::fromUtf8((*m_res)[at()][pos].c_str()); //utf8? } else if (f->isFPNumericType()) { @@ -249,7 +249,7 @@ QVariant pqxxSqlCursor::pValue(uint pos)const return pgsqlCStrToVariant((*m_res)[at()][pos]); } - return QString::fromUtf8((*m_res)[at()][pos].c_str(), (*m_res)[at()][pos].size()); //utf8? + return TQString::fromUtf8((*m_res)[at()][pos].c_str(), (*m_res)[at()][pos].size()); //utf8? } //================================================================================== @@ -332,7 +332,7 @@ void pqxxSqlCursor::drv_bufferMovePointerPrev() //================================================================================== //Move internal pointer to internal buffer to N //Implementation required but no need in this driver -void pqxxSqlCursor::drv_bufferMovePointerTo(Q_LLONG to) +void pqxxSqlCursor::drv_bufferMovePointerTo(TQ_LLONG to) { Q_UNUSED(to); } diff --git a/kexi/kexidb/drivers/pqxx/pqxxcursor.h b/kexi/kexidb/drivers/pqxx/pqxxcursor.h index d596acca..637a33f3 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxcursor.h +++ b/kexi/kexidb/drivers/pqxx/pqxxcursor.h @@ -17,8 +17,8 @@ * Boston, MA 02110-1301, USA. */ -#ifndef KEXIDB_CURSOR_PQXX_H -#define KEXIDB_CURSOR_PQXX_H +#ifndef KEXIDB_CURSOR_PTQXX_H +#define KEXIDB_CURSOR_PTQXX_H #include <kexidb/cursor.h> #include <kexidb/connection.h> @@ -39,7 +39,7 @@ class pqxxSqlCursor: public Cursor { public: virtual ~pqxxSqlCursor(); - virtual QVariant value(uint i); + virtual TQVariant value(uint i); virtual const char** rowData() const; virtual void storeCurrentRow(RowData &data) const; @@ -47,18 +47,18 @@ public: //TODO virtual int serverResult() const; -//TODO virtual QString serverResultName() const; +//TODO virtual TQString serverResultName() const; -//TODO virtual QString serverErrorMsg() const; +//TODO virtual TQString serverErrorMsg() const; protected: - pqxxSqlCursor(Connection* conn, const QString& statement = QString::null, uint options = NoOptions ); + pqxxSqlCursor(Connection* conn, const TQString& statement = TQString(), uint options = NoOptions ); pqxxSqlCursor(Connection* conn, QuerySchema& query, uint options = NoOptions ); virtual void drv_clearServerResult(); virtual void drv_appendCurrentRecordToBuffer(); virtual void drv_bufferMovePointerNext(); virtual void drv_bufferMovePointerPrev(); - virtual void drv_bufferMovePointerTo(Q_LLONG to); + virtual void drv_bufferMovePointerTo(TQ_LLONG to); virtual bool drv_open(); virtual bool drv_close(); virtual void drv_getNextRecord(); @@ -68,18 +68,18 @@ private: pqxx::result* m_res; // pqxx::nontransaction* m_tran; pqxx::connection* my_conn; - QVariant pValue(uint pos)const; + TQVariant pValue(uint pos)const; bool m_implicityStarted : 1; - //QByteArray processBinaryData(pqxx::binarystring*) const; + //TQByteArray processBinaryData(pqxx::binarystring*) const; friend class pqxxSqlConnection; }; -inline QVariant pgsqlCStrToVariant(const pqxx::result::field& r) +inline TQVariant pgsqlCStrToVariant(const pqxx::result::field& r) { switch(r.type()) { case BOOLOID: - return QString::fromLatin1(r.c_str(), r.size())=="true"; //TODO check formatting + return TQString::tqfromLatin1(r.c_str(), r.size())=="true"; //TODO check formatting case INT2OID: case INT4OID: case INT8OID: @@ -89,19 +89,19 @@ inline QVariant pgsqlCStrToVariant(const pqxx::result::field& r) case NUMERICOID: return r.as(double()); case DATEOID: - return QString::fromUtf8(r.c_str(), r.size()); //TODO check formatting + return TQString::fromUtf8(r.c_str(), r.size()); //TODO check formatting case TIMEOID: - return QString::fromUtf8(r.c_str(), r.size()); //TODO check formatting + return TQString::fromUtf8(r.c_str(), r.size()); //TODO check formatting case TIMESTAMPOID: - return QString::fromUtf8(r.c_str(), r.size()); //TODO check formatting + return TQString::fromUtf8(r.c_str(), r.size()); //TODO check formatting case BYTEAOID: return KexiDB::pgsqlByteaToByteArray(r.c_str(), r.size()); case BPCHAROID: case VARCHAROID: case TEXTOID: - return QString::fromUtf8(r.c_str(), r.size()); //utf8? + return TQString::fromUtf8(r.c_str(), r.size()); //utf8? default: - return QString::fromUtf8(r.c_str(), r.size()); //utf8? + return TQString::fromUtf8(r.c_str(), r.size()); //utf8? } } diff --git a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp index d8e6216d..3d9162ca 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp +++ b/kexi/kexidb/drivers/pqxx/pqxxdriver.cpp @@ -33,8 +33,8 @@ KEXIDB_DRIVER_INFO( pqxxSqlDriver, pqxxsql ) //================================================================================== // -pqxxSqlDriver::pqxxSqlDriver( QObject *parent, const char *name, const QStringList &args ) - : Driver( parent, name, args ) +pqxxSqlDriver::pqxxSqlDriver( TQObject *tqparent, const char *name, const TQStringList &args ) + : Driver( tqparent, name, args ) { d->isFileDriver = false; d->features = SingleTransactions | CursorForward | CursorBackward; @@ -47,7 +47,7 @@ pqxxSqlDriver::pqxxSqlDriver( QObject *parent, const char *name, const QStringLi beh->AUTO_INCREMENT_FIELD_OPTION = ""; beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY"; beh->ALWAYS_AVAILABLE_DATABASE_NAME = "template1"; - beh->QUOTATION_MARKS_FOR_IDENTIFIER = '"'; + beh->TQUOTATION_MARKS_FOR_IDENTIFIER = '"'; beh->SQL_KEYWORDS = keywords; initSQLKeywords(233); @@ -72,7 +72,7 @@ pqxxSqlDriver::pqxxSqlDriver( QObject *parent, const char *name, const QStringLi //================================================================================== //Override the default implementation to allow for NUMERIC type natively -QString pqxxSqlDriver::sqlTypeName(int id_t, int p) const +TQString pqxxSqlDriver::sqlTypeName(int id_t, int p) const { if (id_t==Field::Null) return "NULL"; @@ -110,69 +110,69 @@ pqxxSqlDriver::drv_createConnection( ConnectionData &conn_data ) //================================================================================== // -bool pqxxSqlDriver::isSystemObjectName( const QString& n ) const +bool pqxxSqlDriver::isSystemObjectName( const TQString& n ) const { return Driver::isSystemObjectName(n); } //================================================================================== // -bool pqxxSqlDriver::drv_isSystemFieldName( const QString& ) const +bool pqxxSqlDriver::drv_isSystemFieldName( const TQString& ) const { return false; } //================================================================================== // -bool pqxxSqlDriver::isSystemDatabaseName( const QString& n ) const +bool pqxxSqlDriver::isSystemDatabaseName( const TQString& n ) const { return n.lower()=="template1" || n.lower()=="template0"; } //================================================================================== // -QString pqxxSqlDriver::escapeString( const QString& str) const +TQString pqxxSqlDriver::escapeString( const TQString& str) const { - return QString::fromLatin1("'") - + QString::fromAscii( pqxx::sqlesc(std::string(str.utf8())).c_str() ) - + QString::fromLatin1("'"); + return TQString::tqfromLatin1("'") + + TQString::fromAscii( pqxx::sqlesc(std::string(str.utf8())).c_str() ) + + TQString::tqfromLatin1("'"); } //================================================================================== // -QCString pqxxSqlDriver::escapeString( const QCString& str) const +TQCString pqxxSqlDriver::escapeString( const TQCString& str) const { - return QCString("'") - + QCString( pqxx::sqlesc(QString(str).ascii()).c_str() ) - + QCString("'"); + return TQCString("'") + + TQCString( pqxx::sqlesc(TQString(str).ascii()).c_str() ) + + TQCString("'"); } //================================================================================== // -QString pqxxSqlDriver::drv_escapeIdentifier( const QString& str) const { - return QString(str).replace( '"', "\"\"" ); +TQString pqxxSqlDriver::drv_escapeIdentifier( const TQString& str) const { + return TQString(str).tqreplace( '"', "\"\"" ); } //================================================================================== // -QCString pqxxSqlDriver::drv_escapeIdentifier( const QCString& str) const { - return QCString(str).replace( '"', "\"\"" ); +TQCString pqxxSqlDriver::drv_escapeIdentifier( const TQCString& str) const { + return TQCString(str).tqreplace( '"', "\"\"" ); } //================================================================================== // -QString pqxxSqlDriver::escapeBLOB(const QByteArray& array) const +TQString pqxxSqlDriver::escapeBLOB(const TQByteArray& array) const { return KexiDB::escapeBLOB(array, KexiDB::BLOBEscapeOctal); } -QString pqxxSqlDriver::valueToSQL( uint ftype, const QVariant& v ) const +TQString pqxxSqlDriver::valueToSQL( uint ftype, const TQVariant& v ) const { if (ftype==Field::Boolean) { // use SQL compliant TRUE or FALSE as described here // http://www.postgresql.org/docs/8.0/interactive/datatype-boolean.html // 1 or 0 does not work - return v.toInt()==0 ? QString::fromLatin1("FALSE") : QString::fromLatin1("TRUE"); + return v.toInt()==0 ? TQString::tqfromLatin1("FALSE") : TQString::tqfromLatin1("TRUE"); } return Driver::valueToSQL(ftype, v); } diff --git a/kexi/kexidb/drivers/pqxx/pqxxdriver.h b/kexi/kexidb/drivers/pqxx/pqxxdriver.h index bbfdddc3..779c1368 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxdriver.h +++ b/kexi/kexidb/drivers/pqxx/pqxxdriver.h @@ -17,10 +17,10 @@ * Boston, MA 02110-1301, USA. */ -#ifndef KEXIDB_DRIVER_PQXX_H -#define KEXIDB_DRIVER_PQXX_H +#ifndef KEXIDB_DRIVER_PTQXX_H +#define KEXIDB_DRIVER_PTQXX_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kexidb/driver.h> @@ -34,33 +34,34 @@ class DriverManager; class pqxxSqlDriver : public Driver { Q_OBJECT + TQ_OBJECT KEXIDB_DRIVER public: - pqxxSqlDriver( QObject *parent, const char *name, const QStringList &args = QStringList() ); + pqxxSqlDriver( TQObject *tqparent, const char *name, const TQStringList &args = TQStringList() ); ~pqxxSqlDriver(); - virtual bool isSystemObjectName( const QString& n )const; - virtual bool isSystemDatabaseName( const QString& n )const; + virtual bool isSystemObjectName( const TQString& n )const; + virtual bool isSystemDatabaseName( const TQString& n )const; //! Escape a string for use as a value - virtual QString escapeString( const QString& str) const; - virtual QCString escapeString( const QCString& str) const; - virtual QString sqlTypeName(int id_t, int p=0) const; + virtual TQString escapeString( const TQString& str) const; + virtual TQCString escapeString( const TQCString& str) const; + virtual TQString sqlTypeName(int id_t, int p=0) const; //! Escape BLOB value \a array - virtual QString escapeBLOB(const QByteArray& array) const; + virtual TQString escapeBLOB(const TQByteArray& array) const; /*! Escapes and converts value \a v (for type \a ftype) to string representation required by SQL commands. Reimplemented for boolean type only to use SQL compliant TRUE or FALSE */ - virtual QString valueToSQL( uint ftype, const QVariant& v ) const; + virtual TQString valueToSQL( uint ftype, const TQVariant& v ) const; protected: - virtual QString drv_escapeIdentifier( const QString& str) const; - virtual QCString drv_escapeIdentifier( const QCString& str) const; + virtual TQString drv_escapeIdentifier( const TQString& str) const; + virtual TQCString drv_escapeIdentifier( const TQCString& str) const; virtual Connection *drv_createConnection( ConnectionData &conn_data ); - virtual bool drv_isSystemFieldName( const QString& n )const; + virtual bool drv_isSystemFieldName( const TQString& n )const; private: static const char *keywords[]; diff --git a/kexi/kexidb/drivers/pqxx/pqxxpreparedstatement.h b/kexi/kexidb/drivers/pqxx/pqxxpreparedstatement.h index 232454d3..1421f5a4 100644 --- a/kexi/kexidb/drivers/pqxx/pqxxpreparedstatement.h +++ b/kexi/kexidb/drivers/pqxx/pqxxpreparedstatement.h @@ -22,8 +22,8 @@ // Description: // // -#ifndef PQXXPREPAREDSTATEMENT_H -#define PQXXPREPAREDSTATEMENT_H +#ifndef PTQXXPREPAREDSTATEMENT_H +#define PTQXXPREPAREDSTATEMENT_H #include <kexidb/preparedstatement.h> #include <kexidb/connection_p.h> diff --git a/kexi/kexidb/drivers/sqlite/sqlite_common.pro b/kexi/kexidb/drivers/sqlite/sqlite_common.pro index 81fb85b3..7770eb9d 100644 --- a/kexi/kexidb/drivers/sqlite/sqlite_common.pro +++ b/kexi/kexidb/drivers/sqlite/sqlite_common.pro @@ -2,7 +2,7 @@ include( ../common.pro ) DEFINES += MAKE_KEXIDB_SQLITE_DRIVER_LIB -system( bash kmoc ) +system( bash ktqmoc ) SOURCES = \ sqliteconnection.cpp \ diff --git a/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp b/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp index 8bd8085a..14d2217a 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp +++ b/kexi/kexidb/drivers/sqlite/sqliteadmin.cpp @@ -17,7 +17,7 @@ * Boston, MA 02110-1301, USA. */ -#include <qdir.h> +#include <tqdir.h> #include "sqliteadmin.h" #include <kexidb/drivermanager.h> @@ -36,7 +36,7 @@ SQLiteAdminTools::~SQLiteAdminTools() { } -bool SQLiteAdminTools::vacuum(const KexiDB::ConnectionData& data, const QString& databaseName) +bool SQLiteAdminTools::vacuum(const KexiDB::ConnectionData& data, const TQString& databaseName) { clearError(); #ifdef SQLITE2 @@ -46,12 +46,12 @@ bool SQLiteAdminTools::vacuum(const KexiDB::ConnectionData& data, const QString& #else KexiDB::DriverManager manager; KexiDB::Driver *drv = manager.driver(data.driverName); - QString title( i18n("Could not compact database \"%1\".").arg(QDir::convertSeparators(databaseName)) ); + TQString title( i18n("Could not compact database \"%1\".").tqarg(TQDir::convertSeparators(databaseName)) ); if (!drv) { setError(&manager, title); return false; } - SQLiteVacuum vacuum(data.dbPath()+QDir::separator()+databaseName); + SQLiteVacuum vacuum(data.dbPath()+TQDir::separator()+databaseName); tristate result = vacuum.run(); if (!result) { setError(title); diff --git a/kexi/kexidb/drivers/sqlite/sqliteadmin.h b/kexi/kexidb/drivers/sqlite/sqliteadmin.h index d9f8a6b6..2f9db6c9 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteadmin.h +++ b/kexi/kexidb/drivers/sqlite/sqliteadmin.h @@ -30,7 +30,7 @@ class SQLiteAdminTools : public KexiDB::AdminTools virtual ~SQLiteAdminTools(); /*! Performs vacuum (compacting) for connection \a conn. */ - virtual bool vacuum(const KexiDB::ConnectionData& data, const QString& databaseName); + virtual bool vacuum(const KexiDB::ConnectionData& data, const TQString& databaseName); }; #endif diff --git a/kexi/kexidb/drivers/sqlite/sqlitealter.cpp b/kexi/kexidb/drivers/sqlite/sqlitealter.cpp index cc72e48a..c1903efa 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitealter.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitealter.cpp @@ -24,7 +24,7 @@ #include <kstaticdeleter.h> -#include <qmap.h> +#include <tqmap.h> using namespace KexiDB; @@ -33,15 +33,15 @@ enum SQLiteTypeAffinity { //as defined here: 2.1 Determination Of Column Affinit }; //! helper for affinityForType() -static KStaticDeleter< QMap<int,int> > KexiDB_SQLite_affinityForType_deleter; -QMap<int,int> *KexiDB_SQLite_affinityForType = 0; +static KStaticDeleter< TQMap<int,int> > KexiDB_SQLite_affinityForType_deleter; +TQMap<int,int> *KexiDB_SQLite_affinityForType = 0; //! \return SQLite type affinity for \a type //! See doc/dev/alter_table_type_conversions.ods, page 2 for more info static SQLiteTypeAffinity affinityForType(Field::Type type) { if (!KexiDB_SQLite_affinityForType) { - KexiDB_SQLite_affinityForType_deleter.setObject( KexiDB_SQLite_affinityForType, new QMap<int,int>() ); + KexiDB_SQLite_affinityForType_deleter.setObject( KexiDB_SQLite_affinityForType, new TQMap<int,int>() ); KexiDB_SQLite_affinityForType->insert(Field::Byte, IntAffinity); KexiDB_SQLite_affinityForType->insert(Field::ShortInteger, IntAffinity); KexiDB_SQLite_affinityForType->insert(Field::Integer, IntAffinity); @@ -60,7 +60,7 @@ static SQLiteTypeAffinity affinityForType(Field::Type type) } tristate SQLiteConnection::drv_changeFieldProperty(TableSchema &table, Field& field, - const QString& propertyName, const QVariant& value) + const TQString& propertyName, const TQVariant& value) { /* if (propertyName=="name") { diff --git a/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp b/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp index 6de41c59..27f190b8 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp +++ b/kexi/kexidb/drivers/sqlite/sqliteconnection.cpp @@ -33,9 +33,9 @@ #include <kexidb/error.h> #include <kexiutils/utils.h> -#include <qfile.h> -#include <qdir.h> -#include <qregexp.h> +#include <tqfile.h> +#include <tqdir.h> +#include <tqregexp.h> #include <kgenericfactory.h> #include <kdebug.h> @@ -103,8 +103,8 @@ SQLiteConnection::~SQLiteConnection() bool SQLiteConnection::drv_connect(KexiDB::ServerVersionInfo& version) { KexiDBDrvDbg << "SQLiteConnection::connect()" << endl; - version.string = QString(SQLITE_VERSION); //defined in sqlite3.h - QRegExp re("(\\d+)\\.(\\d+)\\.(\\d+)"); + version.string = TQString(SQLITE_VERSION); //defined in sqlite3.h + TQRegExp re("(\\d+)\\.(\\d+)\\.(\\d+)"); if (re.exactMatch(version.string)) { version.major = re.cap(1).toUInt(); version.minor = re.cap(2).toUInt(); @@ -119,21 +119,21 @@ bool SQLiteConnection::drv_disconnect() return true; } -bool SQLiteConnection::drv_getDatabasesList( QStringList &list ) +bool SQLiteConnection::drv_getDatabasesList( TQStringList &list ) { //this is one-db-per-file database list.append( data()->fileName() ); //more consistent than dbFileName() ? return true; } -bool SQLiteConnection::drv_containsTable( const QString &tableName ) +bool SQLiteConnection::drv_containsTable( const TQString &tableName ) { bool success; - return resultExists(QString("select name from sqlite_master where type='table' and name LIKE %1") - .arg(driver()->escapeString(tableName)), success) && success; + return resultExists(TQString("select name from sqlite_master where type='table' and name LIKE %1") + .tqarg(driver()->escapeString(tableName)), success) && success; } -bool SQLiteConnection::drv_getTablesList( QStringList &list ) +bool SQLiteConnection::drv_getTablesList( TQStringList &list ) { KexiDB::Cursor *cursor; m_sql = "select lower(name) from sqlite_master where type='table'"; @@ -154,19 +154,19 @@ bool SQLiteConnection::drv_getTablesList( QStringList &list ) return deleteCursor(cursor); } -bool SQLiteConnection::drv_createDatabase( const QString &dbName ) +bool SQLiteConnection::drv_createDatabase( const TQString &dbName ) { // SQLite creates a new db is it does not exist return drv_useDatabase(dbName); #if 0 - d->data = sqlite_open( QFile::encodeName( data()->fileName() ), 0/*mode: unused*/, + d->data = sqlite_open( TQFile::encodeName( data()->fileName() ), 0/*mode: unused*/, &d->errmsg_p ); d->storeResult(); return d->data != 0; #endif } -bool SQLiteConnection::drv_useDatabase( const QString &dbName, bool *cancelled, +bool SQLiteConnection::drv_useDatabase( const TQString &dbName, bool *cancelled, MessageHandler* msgHandler ) { Q_UNUSED(dbName); @@ -174,7 +174,7 @@ bool SQLiteConnection::drv_useDatabase( const QString &dbName, bool *cancelled, #ifdef SQLITE2 Q_UNUSED(cancelled); Q_UNUSED(msgHandler); - d->data = sqlite_open( QFile::encodeName( data()->fileName() ), 0/*mode: unused*/, + d->data = sqlite_open( TQFile::encodeName( data()->fileName() ), 0/*mode: unused*/, &d->errmsg_p ); d->storeResult(); return d->data != 0; @@ -187,8 +187,8 @@ bool SQLiteConnection::drv_useDatabase( const QString &dbName, bool *cancelled, const bool wasReadOnly = Connection::isReadOnly(); d->res = sqlite3_open( - //QFile::encodeName( data()->fileName() ), - data()->fileName().utf8(), /* unicode expected since SQLite 3.1 */ + //TQFile::encodeName( data()->fileName() ), + data()->fileName().utf8(), /* tqunicode expected since SQLite 3.1 */ &d->data, exclusiveFlag, allowReadonly /* If 1 and locking fails, try opening in read-only mode */ @@ -200,7 +200,7 @@ bool SQLiteConnection::drv_useDatabase( const QString &dbName, bool *cancelled, if (KMessageBox::Continue != askQuestion( i18n("Do you want to open file \"%1\" as read-only?") - .arg(QDir::convertSeparators(data()->fileName())) + .tqarg(TQDir::convertSeparators(data()->fileName())) + "\n\n" + i18n("The file is probably already open on this or another computer.") + " " + i18n("Could not gain exclusive access for writing the file."), @@ -258,21 +258,21 @@ bool SQLiteConnection::drv_closeDatabase() #endif } -bool SQLiteConnection::drv_dropDatabase( const QString &dbName ) +bool SQLiteConnection::drv_dropDatabase( const TQString &dbName ) { Q_UNUSED(dbName); // Each database is one single SQLite file. - const QString filename = data()->fileName(); - if (QFile(filename).exists() && !QDir().remove(filename)) { + const TQString filename = data()->fileName(); + if (TQFile(filename).exists() && !TQDir().remove(filename)) { setError(ERR_ACCESS_RIGHTS, i18n("Could not remove file \"%1\".") - .arg(QDir::convertSeparators(filename)) + " " + .tqarg(TQDir::convertSeparators(filename)) + " " + i18n("Check the file's permissions and whether it is already opened and locked by another application.")); return false; } return true; } -//CursorData* SQLiteConnection::drv_createCursor( const QString& statement ) -Cursor* SQLiteConnection::prepareQuery( const QString& statement, uint cursor_options ) +//CursorData* SQLiteConnection::drv_createCursor( const TQString& statement ) +Cursor* SQLiteConnection::prepareQuery( const TQString& statement, uint cursor_options ) { return new SQLiteCursor( this, statement, cursor_options ); } @@ -282,10 +282,10 @@ Cursor* SQLiteConnection::prepareQuery( QuerySchema& query, uint cursor_options return new SQLiteCursor( this, query, cursor_options ); } -bool SQLiteConnection::drv_executeSQL( const QString& statement ) +bool SQLiteConnection::drv_executeSQL( const TQString& statement ) { // KexiDBDrvDbg << "SQLiteConnection::drv_executeSQL(" << statement << ")" <<endl; -// QCString st(statement.length()*2); +// TQCString st(statement.length()*2); // st = escapeString( statement.local8Bit() ); //? #ifdef SQLITE_UTF8 d->temp_st = statement.utf8(); @@ -294,7 +294,7 @@ bool SQLiteConnection::drv_executeSQL( const QString& statement ) #endif #ifdef KEXI_DEBUG_GUI - KexiUtils::addKexiDBDebug(QString("ExecuteSQL (SQLite): ")+statement); + KexiUtils::addKexiDBDebug(TQString("ExecuteSQL (SQLite): ")+statement); #endif d->res = sqlite_exec( @@ -310,9 +310,9 @@ bool SQLiteConnection::drv_executeSQL( const QString& statement ) return d->res==SQLITE_OK; } -Q_ULLONG SQLiteConnection::drv_lastInsertRowID() +TQ_ULLONG SQLiteConnection::drv_lastInsertRowID() { - return (Q_ULLONG)sqlite_last_insert_rowid(d->data); + return (TQ_ULLONG)sqlite_last_insert_rowid(d->data); } int SQLiteConnection::serverResult() @@ -320,13 +320,13 @@ int SQLiteConnection::serverResult() return d->res==0 ? Connection::serverResult() : d->res; } -QString SQLiteConnection::serverResultName() +TQString SQLiteConnection::serverResultName() { - QString r = + TQString r = #ifdef SQLITE2 - QString::fromLatin1( sqlite_error_string(d->res) ); + TQString::tqfromLatin1( sqlite_error_string(d->res) ); #else //SQLITE3 - QString::null; //fromLatin1( d->result_name ); + TQString(); //tqfromLatin1( d->result_name ); #endif return r.isEmpty() ? Connection::serverResultName() : r; } @@ -343,7 +343,7 @@ void SQLiteConnection::drv_clearServerResult() #endif } -QString SQLiteConnection::serverErrorMsg() +TQString SQLiteConnection::serverErrorMsg() { return d->errmsg.isEmpty() ? Connection::serverErrorMsg() : d->errmsg; } @@ -366,14 +366,14 @@ bool SQLiteConnection::isReadOnly() const } #ifdef SQLITE2 -bool SQLiteConnection::drv_alterTableName(TableSchema& tableSchema, const QString& newName, bool replace) +bool SQLiteConnection::drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool tqreplace) { - const QString oldTableName = tableSchema.name(); + const TQString oldTableName = tableSchema.name(); const bool destTableExists = this->tableSchema( newName ) != 0; //1. drop the table if (destTableExists) { - if (!replace) + if (!tqreplace) return false; if (!drv_dropTable( newName )) return false; @@ -395,8 +395,8 @@ bool SQLiteConnection::drv_alterTableName(TableSchema& tableSchema, const QStrin //TODO indices, etc.??? // 3. copy all rows to the new table - if (!executeSQL(QString::fromLatin1("INSERT INTO %1 SELECT * FROM %2") - .arg(escapeIdentifier(tableSchema.name())).arg(escapeIdentifier(oldTableName)))) + if (!executeSQL(TQString::tqfromLatin1("INSERT INTO %1 SELECT * FROM %2") + .tqarg(escapeIdentifier(tableSchema.name())).tqarg(escapeIdentifier(oldTableName)))) { drv_alterTableName_ERR; return false; diff --git a/kexi/kexidb/drivers/sqlite/sqliteconnection.h b/kexi/kexidb/drivers/sqlite/sqliteconnection.h index ba0d3b5a..922e8447 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteconnection.h +++ b/kexi/kexidb/drivers/sqlite/sqliteconnection.h @@ -20,7 +20,7 @@ #ifndef KEXIDB_CONN_SQLITE_H #define KEXIDB_CONN_SQLITE_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kexidb/connection.h> @@ -37,11 +37,12 @@ class Driver; class SQLiteConnection : public Connection { Q_OBJECT + TQ_OBJECT public: virtual ~SQLiteConnection(); - virtual Cursor* prepareQuery( const QString& statement, uint cursor_options = 0 ); + virtual Cursor* prepareQuery( const TQString& statement, uint cursor_options = 0 ); virtual Cursor* prepareQuery( QuerySchema& query, uint cursor_options = 0 ); //#ifndef SQLITE2 //TEMP IFDEF! @@ -57,24 +58,24 @@ class SQLiteConnection : public Connection virtual bool drv_connect(KexiDB::ServerVersionInfo& version); virtual bool drv_disconnect(); - virtual bool drv_getDatabasesList( QStringList &list ); + virtual bool drv_getDatabasesList( TQStringList &list ); //TODO: move this somewhere to low level class (MIGRATION?) - virtual bool drv_getTablesList( QStringList &list ); + virtual bool drv_getTablesList( TQStringList &list ); //TODO: move this somewhere to low level class (MIGRATION?) - virtual bool drv_containsTable( const QString &tableName ); + virtual bool drv_containsTable( const TQString &tableName ); /*! Creates new database using connection. Note: Do not pass \a dbName arg because for file-based engine (that has one database per connection) it is defined during connection. */ - virtual bool drv_createDatabase( const QString &dbName = QString::null ); + virtual bool drv_createDatabase( const TQString &dbName = TQString() ); /*! Opens existing database using connection. Do not pass \a dbName arg because for file-based engine (that has one database per connection) it is defined during connection. If you pass it, database file name will be changed. */ - virtual bool drv_useDatabase( const QString &dbName = QString::null, bool *cancelled = 0, + virtual bool drv_useDatabase( const TQString &dbName = TQString(), bool *cancelled = 0, MessageHandler* msgHandler = 0 ); virtual bool drv_closeDatabase(); @@ -82,21 +83,21 @@ class SQLiteConnection : public Connection /*! Drops database from the server using connection. After drop, database shouldn't be accessible anymore, so database file is just removed. See note from drv_useDatabase(). */ - virtual bool drv_dropDatabase( const QString &dbName = QString::null ); + virtual bool drv_dropDatabase( const TQString &dbName = TQString() ); //virtual bool drv_createTable( const KexiDB::Table& table ); - virtual bool drv_executeSQL( const QString& statement ); -// virtual bool drv_executeQuery( const QString& statement ); + virtual bool drv_executeSQL( const TQString& statement ); +// virtual bool drv_executeQuery( const TQString& statement ); - virtual Q_ULLONG drv_lastInsertRowID(); + virtual TQ_ULLONG drv_lastInsertRowID(); virtual int serverResult(); - virtual QString serverResultName(); - virtual QString serverErrorMsg(); + virtual TQString serverResultName(); + virtual TQString serverErrorMsg(); virtual void drv_clearServerResult(); virtual tristate drv_changeFieldProperty(TableSchema &table, Field& field, - const QString& propertyName, const QVariant& value); + const TQString& propertyName, const TQVariant& value); #ifdef SQLITE2 /*! Alters table's described \a tableSchema name to \a newName. @@ -108,7 +109,7 @@ class SQLiteConnection : public Connection \return true on success. More advanced server backends implement this using "ALTER TABLE .. RENAME TO". */ - virtual bool drv_alterTableName(TableSchema& tableSchema, const QString& newName, bool replace = false); + virtual bool drv_alterTableName(TableSchema& tableSchema, const TQString& newName, bool tqreplace = false); #endif //! for drv_changeFieldProperty() diff --git a/kexi/kexidb/drivers/sqlite/sqliteconnection_p.h b/kexi/kexidb/drivers/sqlite/sqliteconnection_p.h index f295573d..4918c759 100644 --- a/kexi/kexidb/drivers/sqlite/sqliteconnection_p.h +++ b/kexi/kexidb/drivers/sqlite/sqliteconnection_p.h @@ -58,11 +58,11 @@ class SQLiteConnectionInternal : public ConnectionInternal sqlite_struct *data; bool data_owned; //!< true if data pointer should be freed on destruction - QString errmsg; //<! server-specific message of last operation + TQString errmsg; //<! server-specific message of last operation char *errmsg_p; //<! temporary: server-specific message of last operation int res; //<! result code of last operation on server - QCString temp_st; + TQCString temp_st; #ifdef SQLITE3 const char *result_name; #endif diff --git a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp index 4b18b437..5239127c 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitecursor.cpp @@ -33,13 +33,13 @@ #include <kdebug.h> #include <klocale.h> -#include <qptrvector.h> -#include <qdatetime.h> +#include <tqptrvector.h> +#include <tqdatetime.h> using namespace KexiDB; //! safer interpretations of boolean values for SQLite -static bool sqliteStringToBool(const QString& s) +static bool sqliteStringToBool(const TQString& s) { return s.lower()=="yes" || (s.lower()!="no" && s!="0"); } @@ -84,7 +84,7 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal } #endif*/ - QCString st; + TQCString st; //for sqlite: // sqlite_struct *data; //! taken from SQLiteConnection #ifdef SQLITE2 @@ -95,7 +95,7 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal char *utail; -// QString errmsg; //<! server-specific message of last operation +// TQString errmsg; //<! server-specific message of last operation // char *errmsg_p; //<! temporary: server-specific message of last operation // int res; //<! result code of last operation on server @@ -112,7 +112,7 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal uint cols_pointers_mem_size; //! size of record's array of pointers to values int records_in_buf; //! number of records currently stored in the buffer bool buffering_completed; //! true if we have already all records stored in the buffer - QPtrVector<const char*> records; //buffer data + TQPtrVector<const char*> records; //buffer data bool at_buffer; //! true if we already point to the buffer with curr_coldata */ @@ -121,39 +121,39 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal const char **prev_colname;*/ uint cols_pointers_mem_size; //! size of record's array of pointers to values - QPtrVector<const char*> records;//! buffer data + TQPtrVector<const char*> records;//! buffer data //#ifdef SQLITE3 // bool rowDataReadyToFetch : 1; //#endif #ifdef SQLITE3 - inline QVariant getValue(Field *f, int i) + inline TQVariant getValue(Field *f, int i) { int type = sqlite3_column_type(prepared_st_handle, i); if (type==SQLITE_NULL) { - return QVariant(); + return TQVariant(); } else if (!f || type==SQLITE_TEXT) { //TODO: support for UTF-16 -#define GET_sqlite3_column_text QString::fromUtf8( (const char*)sqlite3_column_text(prepared_st_handle, i) ) +#define GET_sqlite3_column_text TQString::fromUtf8( (const char*)sqlite3_column_text(prepared_st_handle, i) ) if (!f || f->isTextType()) return GET_sqlite3_column_text; else { switch (f->type()) { case Field::Date: - return QDate::fromString( GET_sqlite3_column_text, Qt::ISODate ); + return TQDate::fromString( GET_sqlite3_column_text, Qt::ISODate ); case Field::Time: - //QDateTime - a hack needed because QVariant(QTime) has broken isNull() - return KexiUtils::stringToHackedQTime(GET_sqlite3_column_text); + //TQDateTime - a hack needed because TQVariant(TQTime) has broken isNull() + return KexiUtils::stringToHackedTQTime(GET_sqlite3_column_text); case Field::DateTime: { - QString tmp( GET_sqlite3_column_text ); + TQString tmp( GET_sqlite3_column_text ); tmp[10] = 'T'; //for ISODate compatibility - return QDateTime::fromString( tmp, Qt::ISODate ); + return TQDateTime::fromString( tmp, Qt::ISODate ); } case Field::Boolean: - return QVariant(sqliteStringToBool(GET_sqlite3_column_text), 1); + return TQVariant(sqliteStringToBool(GET_sqlite3_column_text), 1); default: - return QVariant(); //TODO + return TQVariant(); //TODO } } } @@ -162,42 +162,42 @@ class KexiDB::SQLiteCursorData : public SQLiteConnectionInternal case Field::Byte: case Field::ShortInteger: case Field::Integer: - return QVariant( sqlite3_column_int(prepared_st_handle, i) ); + return TQVariant( sqlite3_column_int(prepared_st_handle, i) ); case Field::BigInteger: - return QVariant( (Q_LLONG)sqlite3_column_int64(prepared_st_handle, i) ); + return TQVariant( (TQ_LLONG)sqlite3_column_int64(prepared_st_handle, i) ); case Field::Boolean: - return QVariant( sqlite3_column_int(prepared_st_handle, i)!=0, 1 ); + return TQVariant( sqlite3_column_int(prepared_st_handle, i)!=0, 1 ); default:; } if (f->isFPNumericType()) //WEIRD, YEAH? - return QVariant( (double)sqlite3_column_int(prepared_st_handle, i) ); + return TQVariant( (double)sqlite3_column_int(prepared_st_handle, i) ); else - return QVariant(); //TODO + return TQVariant(); //TODO } else if (type==SQLITE_FLOAT) { if (f && f->isFPNumericType()) - return QVariant( sqlite3_column_double(prepared_st_handle, i) ); + return TQVariant( sqlite3_column_double(prepared_st_handle, i) ); else if (!f || f->isIntegerType()) - return QVariant( (double)sqlite3_column_double(prepared_st_handle, i) ); + return TQVariant( (double)sqlite3_column_double(prepared_st_handle, i) ); else - return QVariant(); //TODO + return TQVariant(); //TODO } else if (type==SQLITE_BLOB) { if (f && f->type()==Field::BLOB) { - QByteArray ba; + TQByteArray ba; //! @todo efficient enough? ba.duplicate((const char*)sqlite3_column_blob(prepared_st_handle, i), sqlite3_column_bytes(prepared_st_handle, i)); return ba; } else - return QVariant(); //TODO + return TQVariant(); //TODO } - return QVariant(); + return TQVariant(); } #endif //SQLITE3 }; -SQLiteCursor::SQLiteCursor(Connection* conn, const QString& statement, uint options) +SQLiteCursor::SQLiteCursor(Connection* conn, const TQString& statement, uint options) : Cursor( conn, statement, options ) , d( new SQLiteCursorData(conn) ) { @@ -328,7 +328,7 @@ void SQLiteCursor::drv_getNextRecord() if (m_result == FetchOK && d->curr_coldata) { for (uint i=0;i<m_fieldCount;i++) { KexiDBDrvDbg<<"col."<< i<<": "<< d->curr_colname[i]<<" "<< d->curr_colname[m_fieldCount+i] - << " = " << (d->curr_coldata[i] ? QString::fromLocal8Bit(d->curr_coldata[i]) : "(NULL)") <<endl; + << " = " << (d->curr_coldata[i] ? TQString::fromLocal8Bit(d->curr_coldata[i]) : "(NULL)") <<endl; } // KexiDBDrvDbg << "SQLiteCursor::drv_getNextRecord(): "<<m_fieldCount<<" col(s) fetched"<<endl; }*/ @@ -363,7 +363,7 @@ void SQLiteCursor::drv_bufferMovePointerPrev() //compute a place in the buffer that contain next record's data //and move internal buffer pointer to that place -void SQLiteCursor::drv_bufferMovePointerTo(Q_LLONG at) +void SQLiteCursor::drv_bufferMovePointerTo(TQ_LLONG at) { d->curr_coldata = d->records.at(at); } @@ -432,17 +432,17 @@ void SQLiteCursor::storeCurrentRow(RowData &data) const if (!m_fieldsExpanded) {//simple version: without types for( uint i=0; i<m_fieldCount; i++ ) { #ifdef SQLITE2 - data[i] = QVariant( *col ); + data[i] = TQVariant( *col ); col++; #else //SQLITE3 - data[i] = QString::fromUtf8( (const char*)sqlite3_column_text(d->prepared_st_handle, i) ); + data[i] = TQString::fromUtf8( (const char*)sqlite3_column_text(d->prepared_st_handle, i) ); #endif } return; } //const uint fieldsExpandedCount = m_fieldsExpanded->count(); - const uint maxCount = QMIN(m_fieldCount, m_fieldsExpanded->count()); + const uint maxCount = TQMIN(m_fieldCount, m_fieldsExpanded->count()); // i - visible field's index, j - physical index for( uint i=0, j=0; i<m_fieldCount; i++, j++ ) { // while (j < m_detailedVisibility.count() && !m_detailedVisibility[j]) //!m_query->isColumnVisible(j)) @@ -459,42 +459,42 @@ void SQLiteCursor::storeCurrentRow(RowData &data) const #ifdef SQLITE2 if (!*col) - data[i] = QVariant(); + data[i] = TQVariant(); else if (f && f->isTextType()) # ifdef SQLITE_UTF8 - data[i] = QString::fromUtf8( *col ); + data[i] = TQString::fromUtf8( *col ); # else - data[i] = QVariant( *col ); //only latin1 + data[i] = TQVariant( *col ); //only latin1 # endif else if (f && f->isFPNumericType()) - data[i] = QVariant( QCString(*col).toDouble() ); + data[i] = TQVariant( TQCString(*col).toDouble() ); else { switch (f ? f->type() : Field::Integer/*ROWINFO*/) { //todo: use short, etc. case Field::Byte: case Field::ShortInteger: case Field::Integer: - data[i] = QVariant( QCString(*col).toInt() ); + data[i] = TQVariant( TQCString(*col).toInt() ); case Field::BigInteger: - data[i] = QVariant( QString::fromLatin1(*col).toLongLong() ); + data[i] = TQVariant( TQString::tqfromLatin1(*col).toLongLong() ); case Field::Boolean: - data[i] = QVariant( sqliteStringToBool(QString::fromLatin1(*col)), 1 ); + data[i] = TQVariant( sqliteStringToBool(TQString::tqfromLatin1(*col)), 1 ); break; case Field::Date: - data[i] = QDate::fromString( QString::fromLatin1(*col), Qt::ISODate ); + data[i] = TQDate::fromString( TQString::tqfromLatin1(*col), Qt::ISODate ); break; case Field::Time: - //QDateTime - a hack needed because QVariant(QTime) has broken isNull() - data[i] = KexiUtils::stringToHackedQTime(QString::fromLatin1(*col)); + //TQDateTime - a hack needed because TQVariant(TQTime) has broken isNull() + data[i] = KexiUtils::stringToHackedTQTime(TQString::tqfromLatin1(*col)); break; case Field::DateTime: { - QString tmp( QString::fromLatin1(*col) ); + TQString tmp( TQString::tqfromLatin1(*col) ); tmp[10] = 'T'; - data[i] = QDateTime::fromString( tmp, Qt::ISODate ); + data[i] = TQDateTime::fromString( tmp, Qt::ISODate ); break; } default: - data[i] = QVariant( *col ); + data[i] = TQVariant( *col ); } } @@ -505,11 +505,11 @@ void SQLiteCursor::storeCurrentRow(RowData &data) const } } -QVariant SQLiteCursor::value(uint i) +TQVariant SQLiteCursor::value(uint i) { // if (i > (m_fieldCount-1+(m_containsROWIDInfo?1:0))) //range checking if (i > (m_fieldCount-1)) //range checking - return QVariant(); + return TQVariant(); //TODO: allow disable range checking! - performance reasons // const KexiDB::Field *f = m_query ? m_query->field(i) : 0; KexiDB::Field *f = (m_fieldsExpanded && i<m_fieldsExpanded->count()) @@ -518,13 +518,13 @@ QVariant SQLiteCursor::value(uint i) //from most to least frequently used types: //(m_logicalFieldCount introduced) if (i==m_fieldCount || f && f->isIntegerType()) if (!f || f->isIntegerType()) - return QVariant( QCString(d->curr_coldata[i]).toInt() ); + return TQVariant( TQCString(d->curr_coldata[i]).toInt() ); else if (!f || f->isTextType()) - return QVariant( d->curr_coldata[i] ); + return TQVariant( d->curr_coldata[i] ); else if (f->isFPNumericType()) - return QVariant( QCString(d->curr_coldata[i]).toDouble() ); + return TQVariant( TQCString(d->curr_coldata[i]).toDouble() ); - return QVariant( d->curr_coldata[i] ); //default + return TQVariant( d->curr_coldata[i] ); //default #else return d->getValue(f, i); //, i==m_logicalFieldCount/*ROWID*/); #endif @@ -532,7 +532,7 @@ QVariant SQLiteCursor::value(uint i) /*! Stores string value taken from field number \a i to \a str. \return false when range checking failed. -bool SQLiteCursor::storeStringValue(uint i, QString &str) +bool SQLiteCursor::storeStringValue(uint i, TQString &str) { if (i > (m_fieldCount-1)) //range checking return false; @@ -545,16 +545,16 @@ int SQLiteCursor::serverResult() return d->res; } -QString SQLiteCursor::serverResultName() +TQString SQLiteCursor::serverResultName() { #ifdef SQLITE2 - return QString::fromLatin1( sqlite_error_string(d->res) ); + return TQString::tqfromLatin1( sqlite_error_string(d->res) ); #else //SQLITE3 - return QString::fromLatin1( d->result_name ); + return TQString::tqfromLatin1( d->result_name ); #endif } -QString SQLiteCursor::serverErrorMsg() +TQString SQLiteCursor::serverErrorMsg() { return d->errmsg; } diff --git a/kexi/kexidb/drivers/sqlite/sqlitecursor.h b/kexi/kexidb/drivers/sqlite/sqlitecursor.h index b7170f67..d5e7c05e 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitecursor.h +++ b/kexi/kexidb/drivers/sqlite/sqlitecursor.h @@ -20,7 +20,7 @@ #ifndef KEXIDB_SQLITECURSOR_H #define KEXIDB_SQLITECURSOR_H -#include <qstring.h> +#include <tqstring.h> #include <kexidb/cursor.h> #include "connection.h" @@ -36,7 +36,7 @@ class SQLiteCursor : public Cursor { public: virtual ~SQLiteCursor(); - virtual QVariant value(uint i); + virtual TQVariant value(uint i); /*! [PROTOTYPE] \return internal buffer data. */ //TODO virtual const char *** bufferData() @@ -48,12 +48,12 @@ class SQLiteCursor : public Cursor // virtual bool save(RowData& data, RowEditBuffer& buf); virtual int serverResult(); - virtual QString serverResultName(); - virtual QString serverErrorMsg(); + virtual TQString serverResultName(); + virtual TQString serverErrorMsg(); protected: /*! Cursor will operate on \a conn, raw \a statement will be used to execute query. */ - SQLiteCursor(Connection* conn, const QString& statement, uint options = NoOptions ); + SQLiteCursor(Connection* conn, const TQString& statement, uint options = NoOptions ); /*! Cursor will operate on \a conn, \a query schema will be used to execute query. */ SQLiteCursor(Connection* conn, QuerySchema& query, @@ -69,7 +69,7 @@ class SQLiteCursor : public Cursor virtual void drv_appendCurrentRecordToBuffer(); virtual void drv_bufferMovePointerNext(); virtual void drv_bufferMovePointerPrev(); - virtual void drv_bufferMovePointerTo(Q_LLONG at); + virtual void drv_bufferMovePointerTo(TQ_LLONG at); //TODO virtual void drv_storeCurrentRecord(); diff --git a/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp b/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp index e2abc246..c5128b63 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitedriver.cpp @@ -48,9 +48,9 @@ class KexiDB::SQLiteDriverPrivate } }; -//PgSqlDB::PgSqlDB(QObject *parent, const char *name, const QStringList &) -SQLiteDriver::SQLiteDriver( QObject *parent, const char *name, const QStringList &args ) - : Driver( parent, name, args ) +//PgSqlDB::PgSqlDB(TQObject *tqparent, const char *name, const TQStringList &) +SQLiteDriver::SQLiteDriver( TQObject *tqparent, const char *name, const TQStringList &args ) + : Driver( tqparent, name, args ) ,dp( new SQLiteDriverPrivate() ) { d->isFileDriver = true; @@ -66,11 +66,11 @@ SQLiteDriver::SQLiteDriver( QObject *parent, const char *name, const QStringList beh->AUTO_INCREMENT_FIELD_OPTION = ""; //not available beh->AUTO_INCREMENT_TYPE = "INTEGER"; beh->AUTO_INCREMENT_PK_FIELD_OPTION = "PRIMARY KEY"; - beh->AUTO_INCREMENT_REQUIRES_PK = true; + beh->AUTO_INCREMENT_RETQUIRES_PK = true; beh->ROW_ID_FIELD_NAME = "OID"; - beh->_1ST_ROW_READ_AHEAD_REQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=true; - beh->QUOTATION_MARKS_FOR_IDENTIFIER='"'; - beh->SELECT_1_SUBQUERY_SUPPORTED = true; + beh->_1ST_ROW_READ_AHEAD_RETQUIRED_TO_KNOW_IF_THE_RESULT_IS_EMPTY=true; + beh->TQUOTATION_MARKS_FOR_IDENTIFIER='"'; + beh->SELECT_1_SUBTQUERY_SUPPORTED = true; beh->SQL_KEYWORDS = keywords; initSQLKeywords(29); @@ -110,41 +110,41 @@ SQLiteDriver::drv_createConnection( ConnectionData &conn_data ) return new SQLiteConnection( this, conn_data ); } -bool SQLiteDriver::isSystemObjectName( const QString& n ) const +bool SQLiteDriver::isSystemObjectName( const TQString& n ) const { return Driver::isSystemObjectName(n) || n.lower().startsWith("sqlite_"); } -bool SQLiteDriver::drv_isSystemFieldName( const QString& n ) const +bool SQLiteDriver::drv_isSystemFieldName( const TQString& n ) const { return n.lower()=="_rowid_" || n.lower()=="rowid" || n.lower()=="oid"; } -QString SQLiteDriver::escapeString(const QString& str) const +TQString SQLiteDriver::escapeString(const TQString& str) const { - return QString("'")+QString(str).replace( '\'', "''" ) + "'"; + return TQString("'")+TQString(str).tqreplace( '\'', "''" ) + "'"; } -QCString SQLiteDriver::escapeString(const QCString& str) const +TQCString SQLiteDriver::escapeString(const TQCString& str) const { - return QCString("'")+QCString(str).replace( '\'', "''" )+"'"; + return TQCString("'")+TQCString(str).tqreplace( '\'', "''" )+"'"; } -QString SQLiteDriver::escapeBLOB(const QByteArray& array) const +TQString SQLiteDriver::escapeBLOB(const TQByteArray& array) const { return KexiDB::escapeBLOB(array, KexiDB::BLOBEscapeXHex); } -QString SQLiteDriver::drv_escapeIdentifier( const QString& str) const +TQString SQLiteDriver::drv_escapeIdentifier( const TQString& str) const { - return QString(str).replace( '"', "\"\"" ); + return TQString(str).tqreplace( '"', "\"\"" ); } -QCString SQLiteDriver::drv_escapeIdentifier( const QCString& str) const +TQCString SQLiteDriver::drv_escapeIdentifier( const TQCString& str) const { - return QCString(str).replace( '"', "\"\"" ); + return TQCString(str).tqreplace( '"', "\"\"" ); } AdminTools* SQLiteDriver::drv_createAdminTools() const diff --git a/kexi/kexidb/drivers/sqlite/sqlitedriver.h b/kexi/kexidb/drivers/sqlite/sqlitedriver.h index 66d4d4d2..a388d823 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitedriver.h +++ b/kexi/kexidb/drivers/sqlite/sqlitedriver.h @@ -20,7 +20,7 @@ #ifndef KEXIDB_DRIVER_SQLITE_H #define KEXIDB_DRIVER_SQLITE_H -#include <qstringlist.h> +#include <tqstringlist.h> #include <kexidb/driver.h> @@ -35,31 +35,32 @@ class SQLiteDriverPrivate; class SQLiteDriver : public Driver { Q_OBJECT + TQ_OBJECT KEXIDB_DRIVER public: - SQLiteDriver( QObject *parent, const char *name, const QStringList &args = QStringList() ); + SQLiteDriver( TQObject *tqparent, const char *name, const TQStringList &args = TQStringList() ); virtual ~SQLiteDriver(); /*! \return true if \a n is a system object name; for this driver any object with name prefixed with "sqlite_" is considered as system object. */ - virtual bool isSystemObjectName( const QString& n ) const; + virtual bool isSystemObjectName( const TQString& n ) const; /*! \return false for this driver. */ - virtual bool isSystemDatabaseName( const QString& ) const { return false; } + virtual bool isSystemDatabaseName( const TQString& ) const { return false; } //! Escape a string for use as a value - virtual QString escapeString(const QString& str) const; - virtual QCString escapeString(const QCString& str) const; + virtual TQString escapeString(const TQString& str) const; + virtual TQCString escapeString(const TQCString& str) const; //! Escape BLOB value \a array - virtual QString escapeBLOB(const QByteArray& array) const; + virtual TQString escapeBLOB(const TQByteArray& array) const; protected: - virtual QString drv_escapeIdentifier( const QString& str) const; - virtual QCString drv_escapeIdentifier( const QCString& str) const; + virtual TQString drv_escapeIdentifier( const TQString& str) const; + virtual TQCString drv_escapeIdentifier( const TQCString& str) const; virtual Connection *drv_createConnection( ConnectionData &conn_data ); virtual AdminTools* drv_createAdminTools() const; @@ -67,7 +68,7 @@ class SQLiteDriver : public Driver for this driver fields with name equal "_ROWID_" is considered as system field. */ - virtual bool drv_isSystemFieldName( const QString& n ) const; + virtual bool drv_isSystemFieldName( const TQString& n ) const; SQLiteDriverPrivate *dp; diff --git a/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp b/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp index 9103b131..bccfd11b 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitepreparedstatement.cpp @@ -93,7 +93,7 @@ bool SQLitePreparedStatement::execute() else assert(0); //impl. error - for (QValueListConstIterator<QVariant> it = m_args.constBegin(); + for (TQValueListConstIterator<TQVariant> it = m_args.constBegin(); (field = itFields.current()); ++it, ++itFields, arg++) { if (it==m_args.constEnd() || (*it).isNull()) {//no value to bind or the value is null: bind NULL @@ -106,7 +106,7 @@ bool SQLitePreparedStatement::execute() } if (field->isTextType()) { //! @todo optimize: make a static copy so SQLITE_STATIC can be used - QCString utf8String((*it).toString().utf8()); + TQCString utf8String((*it).toString().utf8()); res = sqlite3_bind_text(prepared_st_handle, arg, (const char*)utf8String, utf8String.length(), SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { @@ -150,7 +150,7 @@ bool SQLitePreparedStatement::execute() { //! @todo what about unsigned > LLONG_MAX ? bool ok; - Q_LLONG value = (*it).toLongLong(&ok); + TQ_LLONG value = (*it).toLongLong(&ok); if (ok) { res = sqlite3_bind_int64(prepared_st_handle, arg, value); if (SQLITE_OK != res) { @@ -169,7 +169,7 @@ bool SQLitePreparedStatement::execute() } case KexiDB::Field::Boolean: res = sqlite3_bind_text(prepared_st_handle, arg, - QString::number((*it).toBool() ? 1 : 0).latin1(), + TQString::number((*it).toBool() ? 1 : 0).latin1(), 1, SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { //! @todo msg? @@ -178,7 +178,7 @@ bool SQLitePreparedStatement::execute() break; case KexiDB::Field::Time: res = sqlite3_bind_text(prepared_st_handle, arg, - (*it).toTime().toString(Qt::ISODate).latin1(), + TQString((*it).toTime().toString(Qt::ISODate)).latin1(), sizeof("HH:MM:SS"), SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { //! @todo msg? @@ -187,7 +187,7 @@ bool SQLitePreparedStatement::execute() break; case KexiDB::Field::Date: res = sqlite3_bind_text(prepared_st_handle, arg, - (*it).toDate().toString(Qt::ISODate).latin1(), + TQString((*it).toDate().toString(Qt::ISODate)).latin1(), sizeof("YYYY-MM-DD"), SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { //! @todo msg? @@ -205,7 +205,7 @@ bool SQLitePreparedStatement::execute() break; case KexiDB::Field::BLOB: { - const QByteArray byteArray((*it).toByteArray()); + const TQByteArray byteArray((*it).toByteArray()); res = sqlite3_bind_blob(prepared_st_handle, arg, (const char*)byteArray, byteArray.size(), SQLITE_TRANSIENT /*??*/); if (SQLITE_OK != res) { diff --git a/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp b/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp index adf8709a..d24d906d 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp +++ b/kexi/kexidb/drivers/sqlite/sqlitevacuum.cpp @@ -28,15 +28,15 @@ #include <kmessagebox.h> #include <kio/global.h> -#include <qfileinfo.h> -#include <qdir.h> -#include <qapplication.h> -#include <qprocess.h> -#include <qcursor.h> +#include <tqfileinfo.h> +#include <tqdir.h> +#include <tqapplication.h> +#include <tqprocess.h> +#include <tqcursor.h> #include <unistd.h> -SQLiteVacuum::SQLiteVacuum(const QString& filePath) +SQLiteVacuum::SQLiteVacuum(const TQString& filePath) : m_filePath(filePath) { m_process = 0; @@ -55,35 +55,35 @@ SQLiteVacuum::~SQLiteVacuum() tristate SQLiteVacuum::run() { - const QString ksqlite_app = KStandardDirs::findExe( "ksqlite" ); + const TQString ksqlite_app = KStandardDirs::findExe( "ksqlite" ); if (ksqlite_app.isEmpty()) { m_result = false; return m_result; } - QFileInfo fi(m_filePath); + TQFileInfo fi(m_filePath); if (!fi.isReadable()) { KexiDBDrvWarn << "SQLiteVacuum::run(): No such file" << m_filePath << endl; return false; } const uint origSize = fi.size(); - QStringList args; + TQStringList args; args << ksqlite_app << "-verbose-vacuum" << m_filePath << "vacuum"; - m_process = new QProcess(args, this, "process"); - m_process->setWorkingDirectory( QFileInfo(m_filePath).dir(true) ); - connect( m_process, SIGNAL(readyReadStdout()), this, SLOT(readFromStdout()) ); - connect( m_process, SIGNAL(processExited()), this, SLOT(processExited()) ); + m_process = new TQProcess(args, this, "process"); + m_process->setWorkingDirectory( TQFileInfo(m_filePath).dir(true) ); + connect( m_process, TQT_SIGNAL(readyReadStdout()), this, TQT_SLOT(readFromStdout()) ); + connect( m_process, TQT_SIGNAL(processExited()), this, TQT_SLOT(processExited()) ); if (!m_process->start()) { m_result = false; return m_result; } m_dlg = new KProgressDialog(0, 0, i18n("Compacting database"), "<qt>"+i18n("Compacting database \"%1\"...") - .arg("<nobr>"+QDir::convertSeparators(QFileInfo(m_filePath).fileName())+"</nobr>") + .tqarg("<nobr>"+TQDir::convertSeparators(TQFileInfo(m_filePath).fileName())+"</nobr>") ); m_dlg->adjustSize(); m_dlg->resize(300, m_dlg->height()); - connect(m_dlg, SIGNAL(cancelClicked()), this, SLOT(cancelClicked())); + connect(m_dlg, TQT_SIGNAL(cancelClicked()), this, TQT_SLOT(cancelClicked())); m_dlg->setMinimumDuration(1000); m_dlg->setAutoClose(true); m_dlg->progressBar()->setTotalSteps(100); @@ -95,10 +95,10 @@ tristate SQLiteVacuum::run() delete m_process; m_process = 0; if (m_result == true) { - const uint newSize = QFileInfo(m_filePath).size(); + const uint newSize = TQFileInfo(m_filePath).size(); const uint decrease = 100-100*newSize/origSize; KMessageBox::information(0, i18n("The database has been compacted. Current size decreased by %1% to %2.") - .arg(decrease).arg(KIO::convertSize(newSize))); + .tqarg(decrease).tqarg(KIO::convertSize(newSize))); } return m_result; } @@ -106,7 +106,7 @@ tristate SQLiteVacuum::run() void SQLiteVacuum::readFromStdout() { while (true) { - QString s( m_process->readLineStdout() ); //readStdout(); + TQString s( m_process->readLineStdout() ); //readStdout(); if (s.isEmpty()) break; m_dlg->progressBar()->setProgress(m_percent); @@ -118,7 +118,7 @@ void SQLiteVacuum::readFromStdout() if (s.mid(8,4)=="100%") { m_percent = 100; m_dlg->setAllowCancel(false); - m_dlg->setCursor(QCursor(Qt::WaitCursor)); + m_dlg->setCursor(TQCursor(TQt::WaitCursor)); } else if (s.mid(9,1)=="%") { m_percent = s.mid(8,1).toInt(); @@ -126,7 +126,7 @@ void SQLiteVacuum::readFromStdout() else if (s.mid(10,1)=="%") { m_percent = s.mid(8,2).toInt(); } - m_process->writeToStdin(" "); + m_process->writeToStdin(TQString(" ")); } } } @@ -142,7 +142,7 @@ void SQLiteVacuum::processExited() void SQLiteVacuum::cancelClicked() { if (!m_process->normalExit()) { - m_process->writeToStdin("q"); //quit + m_process->writeToStdin(TQString("q")); //quit m_result = cancelled; } } diff --git a/kexi/kexidb/drivers/sqlite/sqlitevacuum.h b/kexi/kexidb/drivers/sqlite/sqlitevacuum.h index 4424b7fc..27bcc7ef 100644 --- a/kexi/kexidb/drivers/sqlite/sqlitevacuum.h +++ b/kexi/kexidb/drivers/sqlite/sqlitevacuum.h @@ -20,12 +20,12 @@ #ifndef SQLITE_VACUUM_H #define SQLITE_VACUUM_H -#include <qobject.h> -#include <qstring.h> +#include <tqobject.h> +#include <tqstring.h> #include <kexiutils/tristate.h> -class QProcess; +class TQProcess; class KTempFile; class KProgressDialog; @@ -42,11 +42,12 @@ class KProgressDialog; creates a copy of the original database file, and replaces the orginal with the new only on success. */ -class SQLiteVacuum : public QObject +class SQLiteVacuum : public TQObject { Q_OBJECT + TQ_OBJECT public: - SQLiteVacuum(const QString& filePath); + SQLiteVacuum(const TQString& filePath); ~SQLiteVacuum(); /*! Performs compacting procedure. @@ -60,8 +61,8 @@ class SQLiteVacuum : public QObject void cancelClicked(); protected: - QString m_filePath; - QProcess *m_process; + TQString m_filePath; + TQProcess *m_process; KProgressDialog* m_dlg; int m_percent; tristate m_result; diff --git a/kexi/kexidb/drivers/sqlite2/sqlite2.pro b/kexi/kexidb/drivers/sqlite2/sqlite2.pro index e9597ebd..b3ac6156 100644 --- a/kexi/kexidb/drivers/sqlite2/sqlite2.pro +++ b/kexi/kexidb/drivers/sqlite2/sqlite2.pro @@ -2,9 +2,9 @@ include( ../sqlite/sqlite_common.pro ) LIBS += $$KDELIBDESTDIR/kexisql2$$KDELIBDEBUGLIB -INCLUDEPATH += $(KEXI)/3rdparty/kexisql/src ../sqlite/moc +INCLUDEPATH += $(KEXI)/3rdparty/kexisql/src ../sqlite/tqmoc -system( bash kmoc ../sqlite ) +system( bash ktqmoc ../sqlite ) DEFINES += SQLITE2 |