Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Also hide hidden folders if "show hidden files" is unchecked in data tab #2146

Merged
merged 1 commit into from
Oct 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Hide hidden folders if "show hidden files" is unchecked in data tab
JonathanFeenstra committed Oct 15, 2024

Verified

This commit was signed with the committer’s verified signature.
JonathanFeenstra Jonathan Feenstra
commit 066af8d65458b5c5be7c1c3692c22d84e27227cc
8 changes: 7 additions & 1 deletion src/filetreemodel.cpp
Original file line number Diff line number Diff line change
@@ -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()) {