diff --git a/src/gui/folder.cpp b/src/gui/folder.cpp index ee242f840587..81f93f2b5434 100644 --- a/src/gui/folder.cpp +++ b/src/gui/folder.cpp @@ -108,6 +108,7 @@ Folder::Folder(const FolderDefinition &definition, this, &Folder::slotItemCompleted); connect(_engine.data(), &SyncEngine::newBigFolder, this, &Folder::slotNewBigFolderDiscovered); + connect(_engine.data(), &SyncEngine::existingFolderNowBig, this, &Folder::slotExistingFolderNowBig); connect(_engine.data(), &SyncEngine::seenLockedFile, FolderMan::instance(), &FolderMan::slotSyncOnceFileUnlocks); connect(_engine.data(), &SyncEngine::aboutToPropagate, this, &Folder::slotLogPropagationStart); diff --git a/src/libsync/discovery.cpp b/src/libsync/discovery.cpp index 076591fad5d1..487eac3d7b65 100644 --- a/src/libsync/discovery.cpp +++ b/src/libsync/discovery.cpp @@ -727,7 +727,7 @@ void ProcessDirectoryJob::processFileAnalyzeRemoteInfo(const SyncFileItemPtr &it ENFORCE(dbEntry.isDirectory()); if (differingSize) { - _discoveryData->checkSelectiveSyncExistingFolder(path._server, serverEntry.remotePerm, sizeOnServer); + _discoveryData->checkSelectiveSyncExistingFolder(path._server, sizeOnServer); } item->_instruction = CSYNC_INSTRUCTION_UPDATE_METADATA; diff --git a/src/libsync/discoveryphase.cpp b/src/libsync/discoveryphase.cpp index 878771052399..36702b18678b 100644 --- a/src/libsync/discoveryphase.cpp +++ b/src/libsync/discoveryphase.cpp @@ -157,16 +157,14 @@ void DiscoveryPhase::checkSelectiveSyncNewFolder(const QString &path, checkFolderSizeLimit(path, callback); } -void DiscoveryPhase::checkSelectiveSyncExistingFolder(const QString &path, const RemotePermissions &rp, const qint64 folderSize) +void DiscoveryPhase::checkSelectiveSyncExistingFolder(const QString &path, const qint64 folderSize) { // 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)) { return; } else if (folderSize >= _syncOptions._newBigFolderSizeLimit) { // If the folder is too big, notify the user and prompt for response. - const auto isExternalStorage = - _syncOptions._confirmExternalStorage && _syncOptions._vfs->mode() == Vfs::Off && rp.hasPermission(RemotePermissions::IsMounted); - emit newBigFolder(path, isExternalStorage); + emit existingFolderNowBig(path); } } diff --git a/src/libsync/discoveryphase.h b/src/libsync/discoveryphase.h index 2eed3f2db251..3e7cb6ef9991 100644 --- a/src/libsync/discoveryphase.h +++ b/src/libsync/discoveryphase.h @@ -265,7 +265,7 @@ class DiscoveryPhase : public QObject const RemotePermissions rp, const std::function callback); - void checkSelectiveSyncExistingFolder(const QString &path, const RemotePermissions &rp, const qint64 folderSize); + void checkSelectiveSyncExistingFolder(const QString &path, const qint64 folderSize); /** Given an original path, return the target path obtained when renaming is done. * @@ -323,6 +323,7 @@ class DiscoveryPhase : public QObject // A new folder was discovered and was not synced because of the confirmation feature void newBigFolder(const QString &folder, bool isExternal); + void existingFolderNowBig(const QString &folder); /** For excluded items that don't show up in itemDiscovered() * diff --git a/src/libsync/syncengine.cpp b/src/libsync/syncengine.cpp index 7a13f7133f30..b4fadc45399d 100644 --- a/src/libsync/syncengine.cpp +++ b/src/libsync/syncengine.cpp @@ -656,6 +656,7 @@ void SyncEngine::startSync() connect(_discoveryPhase.data(), &DiscoveryPhase::itemDiscovered, this, &SyncEngine::slotItemDiscovered); connect(_discoveryPhase.data(), &DiscoveryPhase::newBigFolder, this, &SyncEngine::newBigFolder); + connect(_discoveryPhase.data(), &DiscoveryPhase::existingFolderNowBig, this, &SyncEngine::existingFolderNowBig); connect(_discoveryPhase.data(), &DiscoveryPhase::fatalError, this, [this](const QString &errorString, ErrorCategory errorCategory) { Q_EMIT syncError(errorString, errorCategory); finalize(false); diff --git a/src/libsync/syncengine.h b/src/libsync/syncengine.h index fce3a96b6945..d1c4ab9d5169 100644 --- a/src/libsync/syncengine.h +++ b/src/libsync/syncengine.h @@ -187,6 +187,8 @@ public slots: // A new folder was discovered and was not synced because of the confirmation feature void newBigFolder(const QString &folder, bool isExternal); + void existingFolderNowBig(const QString &folder); + /** Emitted when propagation has problems with a locked file. * * Forwarded from OwncloudPropagator::seenLockedFile.