Skip to content

Commit

Permalink
Add config settings for notifying existing folders going over limit
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jul 4, 2023
1 parent 4a8a2c4 commit 90da00e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/libsync/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ static constexpr char downloadLimitC[] = "BWLimit/downloadLimit";

static constexpr char newBigFolderSizeLimitC[] = "newBigFolderSizeLimit";
static constexpr char useNewBigFolderSizeLimitC[] = "useNewBigFolderSizeLimit";
static constexpr char notifyExistingFoldersOverLimitC[] = "notifyExistingFoldersOverLimit";
static constexpr char confirmExternalStorageC[] = "confirmExternalStorage";
static constexpr char moveToTrashC[] = "moveToTrash";

Expand Down Expand Up @@ -959,6 +960,17 @@ bool ConfigFile::useNewBigFolderSizeLimit() const
return getPolicySetting(QLatin1String(useNewBigFolderSizeLimitC), fallback).toBool();
}

bool ConfigFile::notifyExistingFoldersOverLimit() const
{
const auto fallback = getValue(notifyExistingFoldersOverLimitC, {}, true);
return getPolicySetting(QString(notifyExistingFoldersOverLimitC), fallback).toBool();
}

void ConfigFile::setNotifyExistingFoldersOverLimit(const bool notify)
{
setValue(notifyExistingFoldersOverLimitC, notify);
}

void ConfigFile::setConfirmExternalStorage(bool isChecked)
{
setValue(confirmExternalStorageC, isChecked);
Expand Down
2 changes: 2 additions & 0 deletions src/libsync/configfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ class OWNCLOUDSYNC_EXPORT ConfigFile
/** [checked, size in MB] **/
[[nodiscard]] QPair<bool, qint64> newBigFolderSizeLimit() const;
void setNewBigFolderSizeLimit(bool isChecked, qint64 mbytes);
[[nodiscard]] bool notifyExistingFoldersOverLimit() const;
void setNotifyExistingFoldersOverLimit(const bool notify);
[[nodiscard]] bool useNewBigFolderSizeLimit() const;
[[nodiscard]] bool confirmExternalStorage() const;
void setConfirmExternalStorage(bool);
Expand Down

0 comments on commit 90da00e

Please sign in to comment.