mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 18:32:55 +00:00
remove unused SQL plugins drivers constructs
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
0fdc18211a
commit
f2b3cd535c
6 changed files with 9 additions and 84 deletions
|
@ -1003,12 +1003,11 @@ bool QMYSQLResult::exec()
|
|||
/////////////////////////////////////////////////////////
|
||||
|
||||
static int qMySqlConnectionCount = 0;
|
||||
static bool qMySqlInitHandledByUser = false;
|
||||
|
||||
static inline void qLibraryInit()
|
||||
{
|
||||
#ifndef Q_NO_MYSQL_EMBEDDED
|
||||
if (qMySqlInitHandledByUser || qMySqlConnectionCount > 1)
|
||||
if (qMySqlConnectionCount > 1)
|
||||
return;
|
||||
|
||||
# if MYSQL_VERSION_ID < 50000 || MYSQL_VERSION_ID >= 50003
|
||||
|
@ -1033,46 +1032,17 @@ static inline void qLibraryEnd()
|
|||
}
|
||||
|
||||
QMYSQLDriver::QMYSQLDriver(QObject * parent)
|
||||
: QSqlDriver(parent)
|
||||
: QSqlDriver(parent), d(new QMYSQLDriverPrivate())
|
||||
{
|
||||
init();
|
||||
qLibraryInit();
|
||||
}
|
||||
|
||||
/*!
|
||||
Create a driver instance with the open connection handle, \a con.
|
||||
The instance's parent (owner) is \a parent.
|
||||
*/
|
||||
|
||||
QMYSQLDriver::QMYSQLDriver(MYSQL * con, QObject * parent)
|
||||
: QSqlDriver(parent)
|
||||
{
|
||||
init();
|
||||
if (con) {
|
||||
d->mysql = con;
|
||||
#ifndef QT_NO_TEXTCODEC
|
||||
d->tc = codec(con);
|
||||
#endif
|
||||
setOpen(true);
|
||||
setOpenError(false);
|
||||
if (qMySqlConnectionCount == 1)
|
||||
qMySqlInitHandledByUser = true;
|
||||
} else {
|
||||
qLibraryInit();
|
||||
}
|
||||
}
|
||||
|
||||
void QMYSQLDriver::init()
|
||||
{
|
||||
d = new QMYSQLDriverPrivate();
|
||||
d->mysql = Q_NULLPTR;
|
||||
qMySqlConnectionCount++;
|
||||
qLibraryInit();
|
||||
}
|
||||
|
||||
QMYSQLDriver::~QMYSQLDriver()
|
||||
{
|
||||
qMySqlConnectionCount--;
|
||||
if (qMySqlConnectionCount == 0 && !qMySqlInitHandledByUser)
|
||||
if (qMySqlConnectionCount == 0)
|
||||
qLibraryEnd();
|
||||
delete d;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,6 @@ class QMYSQLDriver : public QSqlDriver
|
|||
friend class QMYSQLResult;
|
||||
public:
|
||||
explicit QMYSQLDriver(QObject *parent=0);
|
||||
explicit QMYSQLDriver(MYSQL *con, QObject * parent=0);
|
||||
~QMYSQLDriver();
|
||||
bool hasFeature(DriverFeature f) const;
|
||||
bool open(const QString & db,
|
||||
|
@ -113,7 +112,6 @@ protected:
|
|||
bool commitTransaction();
|
||||
bool rollbackTransaction();
|
||||
private:
|
||||
void init();
|
||||
QMYSQLDriverPrivate* d;
|
||||
};
|
||||
|
||||
|
|
|
@ -1688,26 +1688,8 @@ void QODBCResult::setForwardOnly(bool forward)
|
|||
|
||||
|
||||
QODBCDriver::QODBCDriver(QObject *parent)
|
||||
: QSqlDriver(parent)
|
||||
: QSqlDriver(parent), d(new QODBCDriverPrivate())
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
QODBCDriver::QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent)
|
||||
: QSqlDriver(parent)
|
||||
{
|
||||
init();
|
||||
d->hEnv = env;
|
||||
d->hDbc = con;
|
||||
if (env && con) {
|
||||
setOpen(true);
|
||||
setOpenError(false);
|
||||
}
|
||||
}
|
||||
|
||||
void QODBCDriver::init()
|
||||
{
|
||||
d = new QODBCDriverPrivate();
|
||||
}
|
||||
|
||||
QODBCDriver::~QODBCDriver()
|
||||
|
|
|
@ -87,7 +87,6 @@ class QODBCDriver : public QSqlDriver
|
|||
Q_OBJECT
|
||||
public:
|
||||
explicit QODBCDriver(QObject *parent=0);
|
||||
QODBCDriver(SQLHANDLE env, SQLHANDLE con, QObject * parent=0);
|
||||
virtual ~QODBCDriver();
|
||||
bool hasFeature(DriverFeature f) const;
|
||||
void close();
|
||||
|
@ -115,7 +114,6 @@ protected:
|
|||
bool rollbackTransaction();
|
||||
|
||||
private:
|
||||
void init();
|
||||
bool endTrans();
|
||||
void cleanup();
|
||||
QODBCDriverPrivate* d;
|
||||
|
|
|
@ -48,8 +48,6 @@
|
|||
#include "qnumeric.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <libpq-fe.h>
|
||||
#include <pg_config.h>
|
||||
|
||||
// workaround for postgres defining their OIDs in a private header file
|
||||
#define QBOOLOID 16
|
||||
|
@ -738,27 +736,8 @@ QPSQLDriver::Protocol QPSQLDriverPrivate::getPSQLVersion()
|
|||
}
|
||||
|
||||
QPSQLDriver::QPSQLDriver(QObject *parent)
|
||||
: QSqlDriver(parent)
|
||||
: QSqlDriver(parent), d(new QPSQLDriverPrivate(this))
|
||||
{
|
||||
init();
|
||||
}
|
||||
|
||||
QPSQLDriver::QPSQLDriver(PGconn *conn, QObject *parent)
|
||||
: QSqlDriver(parent)
|
||||
{
|
||||
init();
|
||||
d->connection = conn;
|
||||
if (conn) {
|
||||
d->pro = d->getPSQLVersion();
|
||||
d->detectBackslashEscape();
|
||||
setOpen(true);
|
||||
setOpenError(false);
|
||||
}
|
||||
}
|
||||
|
||||
void QPSQLDriver::init()
|
||||
{
|
||||
d = new QPSQLDriverPrivate(this);
|
||||
}
|
||||
|
||||
QPSQLDriver::~QPSQLDriver()
|
||||
|
|
|
@ -37,10 +37,10 @@
|
|||
#include <QtSql/qsqlresult.h>
|
||||
#include <QtSql/qsqldriver.h>
|
||||
|
||||
QT_BEGIN_HEADER
|
||||
#include <libpq-fe.h>
|
||||
#include <pg_config.h>
|
||||
|
||||
typedef struct pg_conn PGconn;
|
||||
typedef struct pg_result PGresult;
|
||||
QT_BEGIN_HEADER
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
@ -98,7 +98,6 @@ public:
|
|||
};
|
||||
|
||||
explicit QPSQLDriver(QObject *parent=0);
|
||||
explicit QPSQLDriver(PGconn *conn, QObject *parent=0);
|
||||
~QPSQLDriver();
|
||||
bool hasFeature(DriverFeature f) const;
|
||||
bool open(const QString & db,
|
||||
|
@ -133,7 +132,6 @@ private Q_SLOTS:
|
|||
void _q_handleNotification(int);
|
||||
|
||||
private:
|
||||
void init();
|
||||
QPSQLDriverPrivate *d;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue