]> dgit.raspbian.org Git - nextcloud-desktop.git/commitdiff
Add slot for existing folders becoming big in Folder
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 28 Jun 2023 11:33:22 +0000 (19:33 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 4 Aug 2023 09:40:36 +0000 (17:40 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folder.cpp
src/gui/folder.h

index ddb2fb9c58133c868ea77ef43b649e09305bf7f3..9a503853e31a9dd16efaa6d83aaaf712b3485ae4 100644 (file)
@@ -1216,6 +1216,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");
index cac47809ba112c38ee587b92ff402b05002eeec9..78f4023f07ebd7a7fd8a5945928d1cff2e7b3bc9 100644 (file)
@@ -405,6 +405,7 @@ private slots:
     void slotEmitFinishedDelayed();
 
     void slotNewBigFolderDiscovered(const QString &, bool isExternal);
+    void slotExistingFolderNowBig(const QString &folderPath);
 
     void slotLogPropagationStart();