Make sure all queries are initialized on our database object.

Since we use a database with the non default name, we need to do that,
otherwise the query is initialized on the default db which is not open
in our case.
This commit is contained in:
Klaas Freitag 2013-11-22 15:37:35 +01:00
parent 39e48d3d01
commit 65bd4be16e

View file

@ -684,7 +684,7 @@ void SyncJournalDb::wipeBlacklistEntry( const QString& file )
{
QMutexLocker locker(&_mutex);
if( checkConnect() ) {
QSqlQuery query;
QSqlQuery query(_db);
query.prepare("DELETE FROM blacklist WHERE path=:path");
query.bindValue(":path", file);
@ -697,7 +697,7 @@ void SyncJournalDb::wipeBlacklistEntry( const QString& file )
void SyncJournalDb::updateBlacklistEntry( const SyncJournalBlacklistRecord& item )
{
QMutexLocker locker(&_mutex);
QSqlQuery query;
QSqlQuery query(_db);
if( !checkConnect() ) {
return;
@ -711,7 +711,7 @@ void SyncJournalDb::updateBlacklistEntry( const SyncJournalBlacklistRecord& item
return;
}
QSqlQuery iQuery;
QSqlQuery iQuery(_db);
if( query.next() ) {
int retries = query.value(0).toInt();
retries--;