From: Claudio Cambra Date: Wed, 5 Jul 2023 09:16:36 +0000 (+0800) Subject: Add convenience methods to folderman so that classes can add and remove paths from... X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~92^2^2~57^2~34 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7e17e9226bdc88e9153dd15330242807dd93b6dd;p=nextcloud-desktop.git Add convenience methods to folderman so that classes can add and remove paths from folders without needing to know which folder the path belongs to Signed-off-by: Claudio Cambra --- diff --git a/src/gui/folderman.cpp b/src/gui/folderman.cpp index 27a795200..198731a8b 100644 --- a/src/gui/folderman.cpp +++ b/src/gui/folderman.cpp @@ -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; diff --git a/src/gui/folderman.h b/src/gui/folderman.h index 6c236ce8e..03cee25b9 100644 --- a/src/gui/folderman.h +++ b/src/gui/folderman.h @@ -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