mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-22 13:05:51 +03:00
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:
parent
e1f342c320
commit
cbad4347bd
2 changed files with 13 additions and 5 deletions
|
@ -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");
|
||||
|
|
|
@ -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 "/"
|
||||
|
|
Loading…
Reference in a new issue