diff options
| author | Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> | 2024-10-16 08:36:12 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-16 08:36:12 +0200 |
| commit | 61ef16d08d315830ac9d7147749bb5c1486a427f (patch) | |
| tree | 07bfd2aa0ef2ea8cdc12af1de983f8541cce36da | |
| parent | c44ee31e9f50d68cb687d3683ffc91738a819430 (diff) | |
Hide hidden folders if "show hidden files" is unchecked in data tab (#2146)
| -rw-r--r-- | src/filetreemodel.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/filetreemodel.cpp b/src/filetreemodel.cpp index 1fd6d2ab..5a6f6a2c 100644 --- a/src/filetreemodel.cpp +++ b/src/filetreemodel.cpp @@ -979,7 +979,8 @@ bool FileTreeModel::shouldShowFile(const FileEntry& file) const return false; } - if (!showHiddenFiles() && file.getName().ends_with(L".mohidden")) { + if (!showHiddenFiles() && + file.getName().ends_with(ModInfo::s_HiddenExt.toStdWString())) { // hidden files shouldn't be shown, but this file is hidden return false; } @@ -990,6 +991,11 @@ bool FileTreeModel::shouldShowFile(const FileEntry& file) const bool FileTreeModel::shouldShowFolder(const DirectoryEntry& dir, const FileTreeItem* item) const { + if (!showHiddenFiles() && + dir.getName().ends_with(ModInfo::s_HiddenExt.toStdWString())) { + return false; + } + bool shouldPrune = m_flags.testFlag(PruneDirectories); if (m_core.settings().archiveParsing()) { |
