mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-26 14:28:49 +00:00
LibGUI+FileManager: Add setting for showing/hiding dotfiles
GUI::FileSystemModel can now be told to display (or not display) files whose name start with a dot (other than . and ..)
This commit is contained in:
parent
ad57a2f18b
commit
9710c9742c
Notes:
sideshowbarker
2024-07-19 04:42:41 +09:00
Author: https://github.com/awesomekling
Commit: 9710c9742c
3 changed files with 18 additions and 1 deletions
|
@ -91,7 +91,7 @@ void FileSystemModel::Node::traverse_if_needed(const FileSystemModel& model)
|
|||
total_size = 0;
|
||||
|
||||
auto full_path = this->full_path(model);
|
||||
Core::DirIterator di(full_path, Core::DirIterator::SkipDots);
|
||||
Core::DirIterator di(full_path, model.should_show_dotfiles() ? Core::DirIterator::SkipParentAndBaseDir : Core::DirIterator::SkipDots);
|
||||
if (di.has_error()) {
|
||||
m_error = di.error();
|
||||
fprintf(stderr, "DirIterator: %s\n", di.error_string());
|
||||
|
@ -600,4 +600,12 @@ bool FileSystemModel::accepts_drag(const ModelIndex& index, const StringView& da
|
|||
return node.is_directory();
|
||||
}
|
||||
|
||||
void FileSystemModel::set_should_show_dotfiles(bool show)
|
||||
{
|
||||
if (m_should_show_dotfiles == show)
|
||||
return;
|
||||
m_should_show_dotfiles = show;
|
||||
update();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue