mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Ensure newly whitelisted or blacklisted paths are removed from undecided list
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
7d1fa16a3f
commit
5f250a5dad
2 changed files with 16 additions and 0 deletions
|
@ -856,14 +856,29 @@ void Folder::appendPathToSelectiveSyncList(const QString &path, const SyncJourna
|
|||
}
|
||||
}
|
||||
|
||||
void Folder::removePathFromSelectiveSyncList(const QString &path, const SyncJournalDb::SelectiveSyncListType listType)
|
||||
{
|
||||
const auto folderPath = trailingSlashPath(path);
|
||||
const auto journal = journalDb();
|
||||
auto ok = false;
|
||||
auto list = journal->getSelectiveSyncList(listType, &ok);
|
||||
|
||||
if (ok) {
|
||||
list.removeAll(folderPath);
|
||||
journal->setSelectiveSyncList(listType, list);
|
||||
}
|
||||
}
|
||||
|
||||
void Folder::whitelistPath(const QString &path)
|
||||
{
|
||||
appendPathToSelectiveSyncList(path, SyncJournalDb::SelectiveSyncWhiteList);
|
||||
removePathFromSelectiveSyncList(path, SyncJournalDb::SelectiveSyncUndecidedList);
|
||||
}
|
||||
|
||||
void Folder::blacklistPath(const QString &path)
|
||||
{
|
||||
appendPathToSelectiveSyncList(path, SyncJournalDb::SelectiveSyncBlackList);
|
||||
removePathFromSelectiveSyncList(path, SyncJournalDb::SelectiveSyncUndecidedList);
|
||||
}
|
||||
|
||||
bool Folder::isFileExcludedAbsolute(const QString &fullPath) const
|
||||
|
|
|
@ -472,6 +472,7 @@ private:
|
|||
void correctPlaceholderFiles();
|
||||
|
||||
void appendPathToSelectiveSyncList(const QString &path, const SyncJournalDb::SelectiveSyncListType listType);
|
||||
void removePathFromSelectiveSyncList(const QString &path, const SyncJournalDb::SelectiveSyncListType listType);
|
||||
|
||||
AccountStatePtr _accountState;
|
||||
FolderDefinition _definition;
|
||||
|
|
Loading…
Reference in a new issue