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/mySQL/mysqlconnection.cpp | |
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/mySQL/mysqlconnection.cpp')
-rw-r--r-- | kexi/kexidb/drivers/mySQL/mysqlconnection.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
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"; |