Skip to content

Commit

Permalink
Add slot for existing folders becoming big in Folder
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jun 28, 2023
1 parent 23c9a8b commit fbe5251
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/gui/folder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1182,6 +1182,27 @@ void Folder::slotNewBigFolderDiscovered(const QString &newF, bool isExternal)
}
}

void Folder::slotExistingFolderNowBig(const QString &folderPath)
{
const auto trailSlashFolderPath = trailingSlashPath(folderPath);
const auto journal = journalDb();

auto undecidedListQueryOk = false;
auto undecidedList = journal->getSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, &undecidedListQueryOk);
if (undecidedListQueryOk) {
if (!undecidedList.contains(trailSlashFolderPath)) {
undecidedList.append(trailSlashFolderPath);
journal->setSelectiveSyncList(SyncJournalDb::SelectiveSyncUndecidedList, undecidedList);
emit newBigFolderDiscovered(trailSlashFolderPath);
}

const auto message = tr("A folder has surpassed the set folder size limit of %1MB: %2.\n"
"Please go into the settings and disable it if you wish to stop synchronising it.")
.arg(QString::number(ConfigFile().newBigFolderSizeLimit().second), folderPath);
Logger::instance()->postOptionalGuiLog(Theme::instance()->appNameGUI(), message);
}
}

void Folder::slotLogPropagationStart()
{
_fileLog->logLap("Propagation starts");
Expand Down
1 change: 1 addition & 0 deletions src/gui/folder.h
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@ private slots:
void slotEmitFinishedDelayed();

void slotNewBigFolderDiscovered(const QString &, bool isExternal);
void slotExistingFolderNowBig(const QString &folderPath);

void slotLogPropagationStart();

Expand Down

0 comments on commit fbe5251

Please sign in to comment.