From: APTX Date: Fri, 14 Dec 2012 14:43:35 +0000 (+0100) Subject: Always use the Database versions of prepare/exec X-Git-Url: https://gitweb.aptx.org/?a=commitdiff_plain;h=a643677af1ce13456bcb9d7566fd77565b98ef22;p=localmylist.git Always use the Database versions of prepare/exec --- diff --git a/localmylist/mylistnode.cpp b/localmylist/mylistnode.cpp index 0c0d25f..29e3283 100644 --- a/localmylist/mylistnode.cpp +++ b/localmylist/mylistnode.cpp @@ -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;