]> Some of my projects - localmylist.git/commitdiff
Always use the Database versions of prepare/exec
authorAPTX <redacted>
Fri, 14 Dec 2012 14:43:35 +0000 (15:43 +0100)
committerAPTX <redacted>
Fri, 14 Dec 2012 14:43:35 +0000 (15:43 +0100)
localmylist/mylistnode.cpp

index 0c0d25f..29e3283 100644 (file)
@@ -71,9 +71,9 @@ int MyListNode::totalRowCount() const
                return m_totalRowCount;
        }
 
-       QSqlQuery q(LocalMyList::instance()->database()->connection());
+       QSqlQuery &q = LocalMyList::instance()->database()->prepareOneShot(totalRowCountSql());
 
-       if (!q.exec(totalRowCountSql()))
+       if (!LocalMyList::instance()->database()->exec(q))
        {
                m_totalRowCount = 0;
                return 0;