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

index 0c0d25f1b2fef63298e349e8286bb16e79a1bd09..29e3283c0c8e08e5b5b1fe3f5abe5fe23c89f542 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;