summaryrefslogtreecommitdiff
path: root/src/sql
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-01-26 20:07:50 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2020-02-19 06:50:21 +0100
commit3dd5caaaec7c4c0d209b0327b647bfb5d46ac001 (patch)
tree9312131e6ef4f0c0466de63501ddd7c45d1843ea /src/sql
parentfd49b4a2b935362fa76ce3297576addf459bf120 (diff)
downloadqtbase-3dd5caaaec7c4c0d209b0327b647bfb5d46ac001.tar.gz
QtSql: cleanup QSqlDriverPrivate and QSqlResultPrivate
Cleanup QSqlDriverPrivate/QSqlResultPrivate and their derived classes in ODBC, MySql, PostgreSQL and SQLite. Change-Id: I52e69c00cf981b81dde7c3a0370f86f06ef756bb Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src/sql')
-rw-r--r--src/sql/kernel/qsqldriver_p.h13
-rw-r--r--src/sql/kernel/qsqlresult_p.h26
2 files changed, 14 insertions, 25 deletions
diff --git a/src/sql/kernel/qsqldriver_p.h b/src/sql/kernel/qsqldriver_p.h
index c8ec961124..c2cdb25ac2 100644
--- a/src/sql/kernel/qsqldriver_p.h
+++ b/src/sql/kernel/qsqldriver_p.h
@@ -63,19 +63,16 @@ class QSqlDriverPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QSqlDriver)
public:
- QSqlDriverPrivate()
+ QSqlDriverPrivate(QSqlDriver::DbmsType type = QSqlDriver::UnknownDbms)
: QObjectPrivate(),
- isOpen(false),
- isOpenError(false),
- precisionPolicy(QSql::LowPrecisionDouble),
- dbmsType(QSqlDriver::UnknownDbms)
+ dbmsType(type)
{ }
- uint isOpen;
- uint isOpenError;
QSqlError error;
- QSql::NumericalPrecisionPolicy precisionPolicy;
+ QSql::NumericalPrecisionPolicy precisionPolicy = QSql::LowPrecisionDouble;
QSqlDriver::DbmsType dbmsType;
+ bool isOpen = false;
+ bool isOpenError = false;
};
QT_END_NAMESPACE
diff --git a/src/sql/kernel/qsqlresult_p.h b/src/sql/kernel/qsqlresult_p.h
index f0816a7fb5..fe13bcc33f 100644
--- a/src/sql/kernel/qsqlresult_p.h
+++ b/src/sql/kernel/qsqlresult_p.h
@@ -79,14 +79,7 @@ class Q_SQL_EXPORT QSqlResultPrivate
public:
QSqlResultPrivate(QSqlResult *q, const QSqlDriver *drv)
: q_ptr(q),
- sqldriver(const_cast<QSqlDriver*>(drv)),
- idx(QSql::BeforeFirstRow),
- active(false),
- isSel(false),
- forwardOnly(false),
- precisionPolicy(QSql::LowPrecisionDouble),
- bindCount(0),
- binds(QSqlResult::PositionalBinding)
+ sqldriver(const_cast<QSqlDriver*>(drv))
{ }
virtual ~QSqlResultPrivate() { }
@@ -119,18 +112,17 @@ public:
QString namedToPositionalBinding(const QString &query);
QString holderAt(int index) const;
- QSqlResult *q_ptr;
+ QSqlResult *q_ptr = nullptr;
QPointer<QSqlDriver> sqldriver;
- int idx;
QString sql;
- bool active;
- bool isSel;
QSqlError error;
- bool forwardOnly;
- QSql::NumericalPrecisionPolicy precisionPolicy;
-
- int bindCount;
- QSqlResult::BindingSyntax binds;
+ QSql::NumericalPrecisionPolicy precisionPolicy = QSql::LowPrecisionDouble;
+ QSqlResult::BindingSyntax binds = QSqlResult::PositionalBinding;
+ int idx = QSql::BeforeFirstRow;
+ int bindCount = 0;
+ bool active = false;
+ bool isSel = false;
+ bool forwardOnly = false;
QString executedQuery;
QHash<int, QSql::ParamType> types;