Skip to content

Commit

Permalink
Hide hidden folders if "show hidden files" is unchecked in data tab
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanFeenstra committed Oct 15, 2024
1 parent c44ee31 commit 066af8d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/filetreemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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()) {
Expand Down

0 comments on commit 066af8d

Please sign in to comment.