QSQLITE2Driver: use Q_DECLARE_PUBLIC/Q_DECLARE_PRIVATE
Follow-up to 0bdc86d9ef7be8 Change-Id: I0a480b5780eb22b1c22e8a47b3a13ab1cd97b934 Reviewed-by: Andy Shaw <andy.shaw@digia.com>
This commit is contained in:
parent
96e3c2bcbf
commit
f6011ec528
@ -281,8 +281,8 @@ QSQLite2Result::QSQLite2Result(const QSQLite2Driver* db)
|
|||||||
: QSqlCachedResult(db)
|
: QSqlCachedResult(db)
|
||||||
{
|
{
|
||||||
d = new QSQLite2ResultPrivate(this);
|
d = new QSQLite2ResultPrivate(this);
|
||||||
d->access = db->d->access;
|
d->access = db->d_func()->access;
|
||||||
d->utf8 = db->d->utf8;
|
d->utf8 = db->d_func()->utf8;
|
||||||
}
|
}
|
||||||
|
|
||||||
QSQLite2Result::~QSQLite2Result()
|
QSQLite2Result::~QSQLite2Result()
|
||||||
@ -376,16 +376,15 @@ QVariant QSQLite2Result::handle() const
|
|||||||
|
|
||||||
/////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////
|
||||||
|
|
||||||
QSQLite2Driver::QSQLite2Driver(QObject * parent)
|
QSQLite2Driver::QSQLite2Driver(QObject *parent)
|
||||||
: QSqlDriver(parent)
|
: QSqlDriver(*new QSQLite2DriverPrivate, parent)
|
||||||
{
|
{
|
||||||
d = new QSQLite2DriverPrivate();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QSQLite2Driver::QSQLite2Driver(sqlite *connection, QObject *parent)
|
QSQLite2Driver::QSQLite2Driver(sqlite *connection, QObject *parent)
|
||||||
: QSqlDriver(parent)
|
: QSqlDriver(*new QSQLite2DriverPrivate, parent)
|
||||||
{
|
{
|
||||||
d = new QSQLite2DriverPrivate();
|
Q_D(QSQLite2Driver);
|
||||||
d->access = connection;
|
d->access = connection;
|
||||||
setOpen(true);
|
setOpen(true);
|
||||||
setOpenError(false);
|
setOpenError(false);
|
||||||
@ -398,6 +397,7 @@ QSQLite2Driver::~QSQLite2Driver()
|
|||||||
|
|
||||||
bool QSQLite2Driver::hasFeature(DriverFeature f) const
|
bool QSQLite2Driver::hasFeature(DriverFeature f) const
|
||||||
{
|
{
|
||||||
|
Q_D(const QSQLite2Driver);
|
||||||
switch (f) {
|
switch (f) {
|
||||||
case Transactions:
|
case Transactions:
|
||||||
case SimpleLocking:
|
case SimpleLocking:
|
||||||
@ -415,6 +415,7 @@ bool QSQLite2Driver::hasFeature(DriverFeature f) const
|
|||||||
*/
|
*/
|
||||||
bool QSQLite2Driver::open(const QString & db, const QString &, const QString &, const QString &, int, const QString &)
|
bool QSQLite2Driver::open(const QString & db, const QString &, const QString &, const QString &, int, const QString &)
|
||||||
{
|
{
|
||||||
|
Q_D(QSQLite2Driver);
|
||||||
if (isOpen())
|
if (isOpen())
|
||||||
close();
|
close();
|
||||||
|
|
||||||
@ -441,6 +442,7 @@ bool QSQLite2Driver::open(const QString & db, const QString &, const QString &,
|
|||||||
|
|
||||||
void QSQLite2Driver::close()
|
void QSQLite2Driver::close()
|
||||||
{
|
{
|
||||||
|
Q_D(QSQLite2Driver);
|
||||||
if (isOpen()) {
|
if (isOpen()) {
|
||||||
sqlite_close(d->access);
|
sqlite_close(d->access);
|
||||||
d->access = 0;
|
d->access = 0;
|
||||||
@ -456,6 +458,7 @@ QSqlResult *QSQLite2Driver::createResult() const
|
|||||||
|
|
||||||
bool QSQLite2Driver::beginTransaction()
|
bool QSQLite2Driver::beginTransaction()
|
||||||
{
|
{
|
||||||
|
Q_D(QSQLite2Driver);
|
||||||
if (!isOpen() || isOpenError())
|
if (!isOpen() || isOpenError())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -473,6 +476,7 @@ bool QSQLite2Driver::beginTransaction()
|
|||||||
|
|
||||||
bool QSQLite2Driver::commitTransaction()
|
bool QSQLite2Driver::commitTransaction()
|
||||||
{
|
{
|
||||||
|
Q_D(QSQLite2Driver);
|
||||||
if (!isOpen() || isOpenError())
|
if (!isOpen() || isOpenError())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -490,6 +494,7 @@ bool QSQLite2Driver::commitTransaction()
|
|||||||
|
|
||||||
bool QSQLite2Driver::rollbackTransaction()
|
bool QSQLite2Driver::rollbackTransaction()
|
||||||
{
|
{
|
||||||
|
Q_D(QSQLite2Driver);
|
||||||
if (!isOpen() || isOpenError())
|
if (!isOpen() || isOpenError())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
@ -586,6 +591,7 @@ QSqlRecord QSQLite2Driver::record(const QString &tbl) const
|
|||||||
|
|
||||||
QVariant QSQLite2Driver::handle() const
|
QVariant QSQLite2Driver::handle() const
|
||||||
{
|
{
|
||||||
|
Q_D(const QSQLite2Driver);
|
||||||
return QVariant::fromValue(d->access);
|
return QVariant::fromValue(d->access);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,8 +71,9 @@ class QSQLite2Driver;
|
|||||||
|
|
||||||
class QSQLite2Driver : public QSqlDriver
|
class QSQLite2Driver : public QSqlDriver
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
|
||||||
friend class QSQLite2Result;
|
friend class QSQLite2Result;
|
||||||
|
Q_DECLARE_PRIVATE(QSQLite2Driver)
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
explicit QSQLite2Driver(QObject *parent = 0);
|
explicit QSQLite2Driver(QObject *parent = 0);
|
||||||
explicit QSQLite2Driver(sqlite *connection, QObject *parent = 0);
|
explicit QSQLite2Driver(sqlite *connection, QObject *parent = 0);
|
||||||
@ -100,9 +101,6 @@ public:
|
|||||||
QSqlIndex primaryIndex(const QString &table) const;
|
QSqlIndex primaryIndex(const QString &table) const;
|
||||||
QVariant handle() const;
|
QVariant handle() const;
|
||||||
QString escapeIdentifier(const QString &identifier, IdentifierType) const;
|
QString escapeIdentifier(const QString &identifier, IdentifierType) const;
|
||||||
|
|
||||||
private:
|
|
||||||
QSQLite2DriverPrivate* d;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
QT_END_NAMESPACE
|
QT_END_NAMESPACE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user