Commit decb4693 authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Correctly report whether tag changed with SQLite

The SQLite driver does not support querying number of returned results, so
tagsChanged was being wrongly set to true even if no tags were really changed
by the code.
parent eadda1d9
......@@ -581,15 +581,21 @@ bool DataStore::appendItemsTags(const PimItem::List &items, const Tag::List &tag
}
QSqlQuery query = qb.query();
if (query.size() == items.count()) {
continue;
if (query.driver()->hasFeature(QSqlDriver::QuerySize)) {
if (query.size() == items.count()) {
continue;
}
setBoolPtr(tagsChanged, true);
}
setBoolPtr(tagsChanged, true);
while (query.next()) {
existing << query.value(0).value<PimItem::Id>();
}
if (!query.driver()->hasFeature(QSqlDriver::QuerySize)) {
if (existing.size() != items.count()) {
setBoolPtr(tagsChanged, true);
}
}
}
if (!doAppendItemsTag(items, tag, existing, col, silent)) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment