From 066af8d65458b5c5be7c1c3692c22d84e27227cc Mon Sep 17 00:00:00 2001 From: Jonathan Feenstra <26406078+JonathanFeenstra@users.noreply.github.com> Date: Tue, 15 Oct 2024 19:51:00 +0200 Subject: [PATCH] Hide hidden folders if "show hidden files" is unchecked in data tab --- src/filetreemodel.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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()) {