summaryrefslogtreecommitdiff
path: root/platform/qt
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2017-11-07 23:30:52 +0200
committerBruno de Oliveira Abinader <bruno@mapbox.com>2017-11-09 16:13:05 +0200
commit2b03d6e8059020d551bb54fe118eda58d2e6d835 (patch)
treec277c30ef85b6f237da72398525aec67b9a0fa21 /platform/qt
parentc30161e4c8d7cbc95b84f1b8dea8f5c7abe242a2 (diff)
downloadqtlocation-mapboxgl-2b03d6e8059020d551bb54fe118eda58d2e6d835.tar.gz
[Qt] Qt SQLite driver has no setForwardOnly support
Diffstat (limited to 'platform/qt')
-rw-r--r--platform/qt/src/sqlite3.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/platform/qt/src/sqlite3.cpp b/platform/qt/src/sqlite3.cpp
index 7d47ae552b..f5454e0170 100644
--- a/platform/qt/src/sqlite3.cpp
+++ b/platform/qt/src/sqlite3.cpp
@@ -102,7 +102,6 @@ public:
class StatementImpl {
public:
StatementImpl(const QString& sql, const QSqlDatabase& db) : query(db) {
- query.setForwardOnly(true);
if (!query.prepare(sql)) {
checkQueryError(query);
}
@@ -170,8 +169,8 @@ void Database::exec(const std::string &sql) {
statement.append(';');
}
QSqlQuery query(*impl->db);
- query.setForwardOnly(true);
query.prepare(statement);
+
if (!query.exec()) {
checkQueryError(query);
}
@@ -296,12 +295,11 @@ void Statement::bindBlob(int offset, const std::vector<uint8_t>& value, bool ret
bool Statement::run() {
assert(impl);
+
if (impl->query.isValid()) {
return impl->query.next();
}
- assert(!impl->query.isActive());
- impl->query.setForwardOnly(true);
if (!impl->query.exec()) {
checkQueryError(impl->query);
}