summaryrefslogtreecommitdiffstats
path: root/kexi/kexidb/drivers/pqxx/pqxxconnection.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /kexi/kexidb/drivers/pqxx/pqxxconnection.cpp
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-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/pqxx/pqxxconnection.cpp')
-rw-r--r--kexi/kexidb/drivers/pqxx/pqxxconnection.cpp66
1 files changed, 33 insertions, 33 deletions
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;
}