mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 15:06:08 +03:00
Add DiscoveryPhase::checkSelectiveSyncExistingFolder
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
e3dc6be371
commit
7145d73f15
2 changed files with 15 additions and 0 deletions
|
@ -157,6 +157,19 @@ void DiscoveryPhase::checkSelectiveSyncNewFolder(const QString &path,
|
||||||
checkFolderSizeLimit(path, callback);
|
checkFolderSizeLimit(path, callback);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DiscoveryPhase::checkSelectiveSyncExistingFolder(const QString &path, const RemotePermissions &rp, 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* Given a path on the remote, give the path as it is when the rename is done */
|
/* Given a path on the remote, give the path as it is when the rename is done */
|
||||||
QString DiscoveryPhase::adjustRenamedPath(const QString &original, SyncFileItem::Direction d) const
|
QString DiscoveryPhase::adjustRenamedPath(const QString &original, SyncFileItem::Direction d) const
|
||||||
{
|
{
|
||||||
|
|
|
@ -266,6 +266,8 @@ class DiscoveryPhase : public QObject
|
||||||
const RemotePermissions rp,
|
const RemotePermissions rp,
|
||||||
const std::function<void(bool)> callback);
|
const std::function<void(bool)> callback);
|
||||||
|
|
||||||
|
void checkSelectiveSyncExistingFolder(const QString &path, const RemotePermissions &rp, const qint64 folderSize);
|
||||||
|
|
||||||
/** Given an original path, return the target path obtained when renaming is done.
|
/** Given an original path, return the target path obtained when renaming is done.
|
||||||
*
|
*
|
||||||
* Note that it only considers parent directory renames. So if A/B got renamed to C/D,
|
* Note that it only considers parent directory renames. So if A/B got renamed to C/D,
|
||||||
|
|
Loading…
Reference in a new issue