diff options
author | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-02 12:50:45 +0300 |
---|---|---|
committer | Trial97 <alexandru.tripon97@gmail.com> | 2023-07-02 12:50:45 +0300 |
commit | 6c4cf085e028a76dd6c0fb4d9649783b3d97aefd (patch) | |
tree | 859e8a0a8a5fb44fc58c1c18130bad6b9c723e46 /launcher/FileIgnoreProxy.h | |
parent | 87155e346c33288fccb68c3b9029a11b658395b2 (diff) | |
parent | b51f1f1d41a6153c37b1d61a04df8ece5004cc27 (diff) | |
download | PrismLauncher-6c4cf085e028a76dd6c0fb4d9649783b3d97aefd.tar.gz PrismLauncher-6c4cf085e028a76dd6c0fb4d9649783b3d97aefd.tar.bz2 PrismLauncher-6c4cf085e028a76dd6c0fb4d9649783b3d97aefd.zip |
Merge branch 'develop' of https://github.com/PrismLauncher/PrismLauncher into curse
Signed-off-by: Trial97 <alexandru.tripon97@gmail.com>
Diffstat (limited to 'launcher/FileIgnoreProxy.h')
-rw-r--r-- | launcher/FileIgnoreProxy.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/launcher/FileIgnoreProxy.h b/launcher/FileIgnoreProxy.h index a5a1153d..e01a2651 100644 --- a/launcher/FileIgnoreProxy.h +++ b/launcher/FileIgnoreProxy.h @@ -36,6 +36,7 @@ #pragma once +#include <QFileInfo> #include <QSortFilterProxyModel> #include "SeparatorPrefixTree.h" @@ -63,10 +64,22 @@ class FileIgnoreProxy : public QSortFilterProxyModel { inline const SeparatorPrefixTree<'/'>& blockedPaths() const { return blocked; } inline SeparatorPrefixTree<'/'>& blockedPaths() { return blocked; } + // list of file names that need to be removed completely from model + inline QStringList& ignoreFilesWithName() { return m_ignoreFiles; } + // list of relative paths that need to be removed completely from model + inline SeparatorPrefixTree<'/'>& ignoreFilesWithPath() { return m_ignoreFilePaths; } + + bool filterFile(const QString& fileName) const; + protected: bool filterAcceptsColumn(int source_column, const QModelIndex& source_parent) const; + bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const; + + bool ignoreFile(QFileInfo file) const; private: const QString root; SeparatorPrefixTree<'/'> blocked; + QStringList m_ignoreFiles; + SeparatorPrefixTree<'/'> m_ignoreFilePaths; }; |