From 514204c078f048930b0e7f19d88029928b9d800b Mon Sep 17 00:00:00 2001 From: APTX Date: Tue, 26 Mar 2013 21:54:29 +0100 Subject: [PATCH] Use proper exec in AsyncQueryTask --- localmylist/asyncquerytask.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/localmylist/asyncquerytask.cpp b/localmylist/asyncquerytask.cpp index 655fd62..df03fa6 100644 --- a/localmylist/asyncquerytask.cpp +++ b/localmylist/asyncquerytask.cpp @@ -41,11 +41,11 @@ bool AsyncQueryTask::canUseThreads() const void AsyncQueryTask::start() { - QSqlQuery q(db->connection()); + QSqlQuery q = db->prepareOneShot(m_query->query); m_result = new Internal::Result; - if (!q.prepare(m_query->query)) + if (q.lastError().isValid()) { m_result->error = q.lastError().text(); emit finished(); @@ -57,7 +57,7 @@ void AsyncQueryTask::start() q.bindValue(v.name, v.value, v.paramType); } - if (!q.exec()) + if (!db->exec(q)) { m_result->error = q.lastError().text(); } -- 2.52.0