Skip to content

Commit

Permalink
Add convenience methods to folderman so that classes can add and remo…
Browse files Browse the repository at this point in the history
…ve paths from folders without needing to know which folder the path belongs to

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra committed Jul 5, 2023
1 parent 4d528c3 commit 6035585
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/gui/folderman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions src/gui/folderman.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,9 @@ class FolderMan : public QObject
/** 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
Expand Down

0 comments on commit 6035585

Please sign in to comment.