Add convenience methods to folderman so that classes can add and remove paths from...
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Wed, 5 Jul 2023 09:16:36 +0000 (17:16 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Fri, 4 Aug 2023 09:40:39 +0000 (17:40 +0800)
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/folderman.cpp
src/gui/folderman.h

index 27a79520036ff54d9e1ac0a5702101ff0f677cb0..198731a8b0b62514a05f5020d70b64e9b6cc42bd 100644 (file)
@@ -1259,6 +1259,26 @@ Folder *FolderMan::folderForPath(const QString &path)
     return it != folders.cend() ? *it : nullptr;
 }
 
+void FolderMan::whitelistFolderPath(const QString &path)
+{
+    const auto folder = folderForPath(path);
+    if (!folder) {
+        return;
+    }
+
+    folder->whitelistPath(path);
+}
+
+void FolderMan::blacklistFolderPath(const QString &path)
+{
+    const auto folder = folderForPath(path);
+    if (!folder) {
+        return;
+    }
+
+    folder->blacklistPath(path);
+}
+
 QStringList FolderMan::findFileInLocalFolders(const QString &relPath, const AccountPtr acc)
 {
     QStringList re;
index 6c236ce8e8a4b62cccb3822af9bc2655895bba98..03cee25b90f73f59db9733f158582b57b7801fec 100644 (file)
@@ -104,6 +104,9 @@ public:
     /** Returns the folder which the file or directory stored in path is in */
     Folder *folderForPath(const QString &path);
 
+    void whitelistFolderPath(const QString &path);
+    void blacklistFolderPath(const QString &path);
+
     /**
       * returns a list of local files that exist on the local harddisk for an
       * incoming relative server path. The method checks with all existing sync