summaryrefslogtreecommitdiffstats
path: root/src/sql/drivers/psql/qsql_psql.cpp
diff options
context:
space:
mode:
authorAndy Shaw <[email protected]>2013-03-30 19:55:25 +0100
committerThe Qt Project <[email protected]>2013-04-02 19:02:26 +0200
commit406c8ef6e67da5505c7404a2517a8b4204d7c38a (patch)
tree1257c680456e3fa4e386995f7703096982863ac0 /src/sql/drivers/psql/qsql_psql.cpp
parentdcf9c403ba8e903bb52a6fb656c7e2de23383c10 (diff)
Move the dbmstype to QSqlDriverPrivate so it can be used for all drivers
By moving it to QSqlDriverPrivate we make it easier to check what database is actually connected which is particularly useful for the autotests. Change-Id: I54d1c2c998919c1d54efb1b6ac9303070ece54aa Reviewed-by: Mark Brand <[email protected]>
Diffstat (limited to 'src/sql/drivers/psql/qsql_psql.cpp')
-rw-r--r--src/sql/drivers/psql/qsql_psql.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/sql/drivers/psql/qsql_psql.cpp b/src/sql/drivers/psql/qsql_psql.cpp
index 13c985d1df8..aed0a112189 100644
--- a/src/sql/drivers/psql/qsql_psql.cpp
+++ b/src/sql/drivers/psql/qsql_psql.cpp
@@ -54,6 +54,7 @@
#include <qstringlist.h>
#include <qmutex.h>
#include <QtSql/private/qsqlresult_p.h>
+#include <QtSql/private/qsqldriver_p.h>
#include <libpq-fe.h>
#include <pg_config.h>
@@ -121,18 +122,18 @@ inline void qPQfreemem(void *buffer)
PQfreemem(buffer);
}
-class QPSQLDriverPrivate
+class QPSQLDriverPrivate : public QSqlDriverPrivate
{
public:
- QPSQLDriverPrivate(QPSQLDriver *qq)
- : q(qq),
+ QPSQLDriverPrivate(QPSQLDriver *qq) : QSqlDriverPrivate(),
+ q(qq),
connection(0),
isUtf8(false),
pro(QPSQLDriver::Version6),
sn(0),
pendingNotifyCheck(false),
hasBackslashEscape(false)
- { }
+ { dbmsType = PostgreSQL; }
QPSQLDriver *q;
PGconn *connection;
@@ -793,7 +794,6 @@ QPSQLDriver::~QPSQLDriver()
{
if (d->connection)
PQfinish(d->connection);
- delete d;
}
QVariant QPSQLDriver::handle() const