SyncJournalDb::setSelectiveSyncList: Always use a transaction

Issue #6431
This commit is contained in:
Olivier Goffart 2018-04-09 08:49:56 +02:00 committed by Roeland Jago Douma
parent 0afcb23734
commit 613fd30021
No known key found for this signature in database
GPG Key ID: F941078878347C0C

View File

@ -1886,6 +1886,8 @@ void SyncJournalDb::setSelectiveSyncList(SyncJournalDb::SelectiveSyncListType ty
return;
}
startTransaction();
//first, delete all entries of this type
SqlQuery delQuery("DELETE FROM selectivesync WHERE type == ?1", _db);
delQuery.bindValue(1, int(type));
@ -1902,6 +1904,8 @@ void SyncJournalDb::setSelectiveSyncList(SyncJournalDb::SelectiveSyncListType ty
qCWarning(lcDb) << "SQL error when inserting into selective sync" << type << path << delQuery.error();
}
}
commitInternal("setSelectiveSyncList");
}
void SyncJournalDb::avoidRenamesOnNextSync(const QByteArray &path)