diff options
author | Hannah von Reth <hannah.vonreth@owncloud.com> | 2021-12-09 18:11:46 +0300 |
---|---|---|
committer | Hannah von Reth <vonreth@kde.org> | 2021-12-13 20:53:56 +0300 |
commit | f776818cf599a55df4431dc21a20173e6a9d11bf (patch) | |
tree | 28ca5559ceb05a2fba1b217d6f9ba7c7099f8780 /src/common | |
parent | f100deb90127fa169b5d25e380569dadbf6fdf07 (diff) |
Handle local errors with the ignore list
Fixes: #9208, #9133
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/syncjournaldb.cpp | 7 | ||||
-rw-r--r-- | src/common/syncjournaldb.h | 2 | ||||
-rw-r--r-- | src/common/syncjournalfilerecord.h | 7 |
3 files changed, 10 insertions, 6 deletions
diff --git a/src/common/syncjournaldb.cpp b/src/common/syncjournaldb.cpp index fcef0f69a..4f086fcd2 100644 --- a/src/common/syncjournaldb.cpp +++ b/src/common/syncjournaldb.cpp @@ -1607,18 +1607,19 @@ int SyncJournalDb::wipeErrorBlacklist() return -1; } -void SyncJournalDb::wipeErrorBlacklistEntry(const QString &file) +void SyncJournalDb::wipeErrorBlacklistEntry(const QString &relativeFile) { - if (file.isEmpty()) { + if (relativeFile.isEmpty()) { return; } + Q_ASSERT(QFileInfo(relativeFile).isRelative()); QMutexLocker locker(&_mutex); if (checkConnect()) { SqlQuery query(_db); query.prepare("DELETE FROM blacklist WHERE path=?1"); - query.bindValue(1, file); + query.bindValue(1, relativeFile); if (!query.exec()) { sqlFail(QStringLiteral("Deletion of blacklist item failed."), query); } diff --git a/src/common/syncjournaldb.h b/src/common/syncjournaldb.h index 03a222304..59de21e69 100644 --- a/src/common/syncjournaldb.h +++ b/src/common/syncjournaldb.h @@ -87,7 +87,7 @@ public: static qint64 getPHash(const QByteArray &); void setErrorBlacklistEntry(const SyncJournalErrorBlacklistRecord &item); - void wipeErrorBlacklistEntry(const QString &file); + void wipeErrorBlacklistEntry(const QString &relativeFile); void wipeErrorBlacklistCategory(SyncJournalErrorBlacklistRecord::Category category); int wipeErrorBlacklist(); int errorBlackListEntryCount(); diff --git a/src/common/syncjournalfilerecord.h b/src/common/syncjournalfilerecord.h index 5c88f91d4..4d8e95926 100644 --- a/src/common/syncjournalfilerecord.h +++ b/src/common/syncjournalfilerecord.h @@ -67,13 +67,16 @@ operator==(const SyncJournalFileRecord &lhs, class OCSYNC_EXPORT SyncJournalErrorBlacklistRecord { + Q_GADGET public: - enum Category { + enum class Category { /// Normal errors have no special behavior Normal = 0, /// These get a special summary message - InsufficientRemoteStorage + InsufficientRemoteStorage, + LocalSoftError }; + Q_ENUM(Category) SyncJournalErrorBlacklistRecord() : _retryCount(0) |