Extract notifying of existing folder now big to separate static method

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
Claudio Cambra 2023-08-03 15:19:22 +08:00
parent e1f342c320
commit cbad4347bd
No known key found for this signature in database
GPG key ID: C839200C384636B0
2 changed files with 13 additions and 5 deletions

View file

@ -1288,11 +1288,7 @@ void Folder::slotExistingFolderNowBig(const QString &folderPath)
emit newBigFolderDiscovered(trailSlashFolderPath);
}
const auto messageInstruction =
stopSyncing ? "Synchronisation of this folder has been disabled." : "Synchronisation of this folder can be disabled in the settings window.";
const auto message = tr("A folder has surpassed the set folder size limit of %1MB: %2.\n%3")
.arg(QString::number(ConfigFile().newBigFolderSizeLimit().second), folderPath, messageInstruction);
Logger::instance()->postGuiLog(Theme::instance()->appNameGUI(), message);
postExistingFolderNowBigNotification(folderPath);
auto whitelistActivityLink = ActivityLink();
whitelistActivityLink._label = tr("Keep syncing");
@ -1327,6 +1323,16 @@ void Folder::slotExistingFolderNowBig(const QString &folderPath)
}
}
void Folder::postExistingFolderNowBigNotification(const QString &folderPath)
{
const auto stopSyncing = ConfigFile().stopSyncingExistingFoldersOverLimit();
const auto messageInstruction =
stopSyncing ? "Synchronisation of this folder has been disabled." : "Synchronisation of this folder can be disabled in the settings window.";
const auto message = tr("A folder has surpassed the set folder size limit of %1MB: %2.\n%3")
.arg(QString::number(ConfigFile().newBigFolderSizeLimit().second), folderPath, messageInstruction);
Logger::instance()->postGuiLog(Theme::instance()->appNameGUI(), message);
}
void Folder::slotLogPropagationStart()
{
_fileLog->logLap("Propagation starts");

View file

@ -474,6 +474,8 @@ private:
void appendPathToSelectiveSyncList(const QString &path, const SyncJournalDb::SelectiveSyncListType listType);
void removePathFromSelectiveSyncList(const QString &path, const SyncJournalDb::SelectiveSyncListType listType);
static void postExistingFolderNowBigNotification(const QString &folderPath);
AccountStatePtr _accountState;
FolderDefinition _definition;
QString _canonicalLocalPath; // As returned with QFileInfo:canonicalFilePath. Always ends with "/"