diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-12-17 12:46:36 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-12-17 18:28:37 +0300 |
commit | f3d9a6ae9227b2edaa4b5c60e04c75e12e114c59 (patch) | |
tree | 6330d06840e0b8e4327dab118799beff11c6a5d7 /src/gui/folder.cpp | |
parent | bceac219ce5d47beaa9a35bd64187d0edd63816c (diff) |
Handle locks in recursive delete
Diffstat (limited to 'src/gui/folder.cpp')
-rw-r--r-- | src/gui/folder.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index 8ccbf5a37..3e42d50c8 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -605,6 +605,21 @@ void Folder::slotWatchedPathChanged(const QString &path, ChangeReason reason) const QString relativePath = path.mid(this->path().size()); if (reason == ChangeReason::UnLock) { journalDb()->wipeErrorBlacklistEntry(relativePath, SyncJournalErrorBlacklistRecord::Category::LocalSoftError); + + { + // horrible hack to compensate that we don't handle folder deletes on a per file basis + int index = 0; + QString p = relativePath; + while ((index = p.lastIndexOf(QLatin1Char('/'))) != -1) { + p = p.left(index); + const auto rec = journalDb()->errorBlacklistEntry(p); + if (rec.isValid()) { + if (rec._errorCategory == SyncJournalErrorBlacklistRecord::Category::LocalSoftError) { + journalDb()->wipeErrorBlacklistEntry(p); + } + } + } + } } // Add to list of locally modified paths |