SyncJournalDB: Fix deleteBatch

This commit is contained in:
Markus Goetz 2014-10-21 16:37:51 +02:00
parent e5a0db8782
commit d7ac878efd
2 changed files with 6 additions and 1 deletions

View File

@ -236,6 +236,9 @@ void SqlQuery::bindValue(int pos, const QVariant& value)
break; }
}
}
if (res != SQLITE_OK) {
qDebug() << Q_FUNC_INFO << "ERROR" << value.toString() << res;
}
Q_ASSERT( res == SQLITE_OK );
}

View File

@ -667,6 +667,7 @@ static bool deleteBatch(SqlQuery & query, const QStringList & entries, const QSt
qDebug() << "Removing stale " << qPrintable(name) << " entries: " << entries.join(", ");
// FIXME: Was ported from execBatch, check if correct!
foreach( const QString& entry, entries ) {
query.reset();
query.bindValue(1, entry);
if (!query.exec()) {
QString err = query.error();
@ -675,7 +676,8 @@ static bool deleteBatch(SqlQuery & query, const QStringList & entries, const QSt
return false;
}
}
query.reset();
query.reset(); // viel hilft viel ;-)
return true;
}