Skip to content

Commit

Permalink
SyncJournalDb::setSelectiveSyncList: Always use a transaction
Browse files Browse the repository at this point in the history
Issue #6431
  • Loading branch information
ogoffart committed Apr 9, 2018
1 parent 0f5a437 commit c0cf6bb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/common/syncjournaldb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1683,6 +1683,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));
Expand All @@ -1699,6 +1701,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)
Expand Down

0 comments on commit c0cf6bb

Please sign in to comment.