From 61057334f6bf01c2e2865c4cc9f68c968bc69b2c Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 4 Jul 2023 22:03:50 +0800 Subject: [PATCH] Do not notify if setting is not enabled for folders going over limit Signed-off-by: Claudio Cambra --- src/libsync/discoveryphase.cpp | 9 +++++++-- src/libsync/discoveryphase.h | 3 ++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 8f2f1e7c8..14ff89794 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -13,6 +13,7 @@ */ #include "discoveryphase.h" +#include "configfile.h" #include "discovery.h" #include "helpers.h" #include "progressdispatcher.h" @@ -87,6 +88,11 @@ bool DiscoveryPhase::activeFolderSizeLimit() const return _syncOptions._newBigFolderSizeLimit > 0 && _syncOptions._vfs->mode() == Vfs::Off; } +bool DiscoveryPhase::notifyExistingFolderOverLimit() const +{ + return activeFolderSizeLimit() && ConfigFile().notifyExistingFoldersOverLimit(); +} + void DiscoveryPhase::checkFolderSizeLimit(const QString &path, const std::function completionCallback) { if (!activeFolderSizeLimit()) { @@ -152,9 +158,8 @@ void DiscoveryPhase::checkSelectiveSyncNewFolder(const QString &path, void DiscoveryPhase::checkSelectiveSyncExistingFolder(const QString &path) { - // TODO: Check for setting to obey big folder sync // If no size limit is enforced, or if is in whitelist (explicitly allowed) or in blacklist (explicitly disallowed), do nothing. - if (!activeFolderSizeLimit() || findPathInList(_selectiveSyncWhiteList, path) || findPathInList(_selectiveSyncBlackList, path)) { + if (!notifyExistingFolderOverLimit() || findPathInList(_selectiveSyncWhiteList, path) || findPathInList(_selectiveSyncBlackList, path)) { return; } diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index dce4261e8..900584066 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -256,7 +256,8 @@ class DiscoveryPhase : public QObject [[nodiscard]] bool isInSelectiveSyncBlackList(const QString &path) const; [[nodiscard]] bool activeFolderSizeLimit() const; - + [[nodiscard]] bool notifyExistingFolderOverLimit() const; + void checkFolderSizeLimit(const QString &path, const std::function callback); -- 2.30.2