mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
FileManager: Remove one direct call to FileSystemModel from outside
We should stop accessing the FileSystemModel outside DirectoryView. This whole app is pretty badly factored, due to LibGUI being in its infancy while it first developed.
This commit is contained in:
parent
aae296ef08
commit
6caaa2bfdb
Notes:
sideshowbarker
2024-07-19 03:41:19 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6caaa2bfdb0
3 changed files with 8 additions and 1 deletions
|
@ -355,3 +355,8 @@ void DirectoryView::update_statusbar()
|
|||
|
||||
set_status_message(builder.to_string());
|
||||
}
|
||||
|
||||
void DirectoryView::set_should_show_dotfiles(bool show_dotfiles)
|
||||
{
|
||||
m_model->set_should_show_dotfiles(show_dotfiles);
|
||||
}
|
||||
|
|
|
@ -110,6 +110,8 @@ public:
|
|||
callback(*m_columns_view);
|
||||
}
|
||||
|
||||
void set_should_show_dotfiles(bool);
|
||||
|
||||
GUI::FileSystemModel& model() { return *m_model; }
|
||||
|
||||
private:
|
||||
|
|
|
@ -678,7 +678,7 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
|
|||
view_menu.add_action(*view_as_columns_action);
|
||||
view_menu.add_separator();
|
||||
view_menu.add_action(GUI::Action::create_checkable("Show dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) {
|
||||
directory_view.model().set_should_show_dotfiles(action.is_checked());
|
||||
directory_view.set_should_show_dotfiles(action.is_checked());
|
||||
}));
|
||||
|
||||
auto& go_menu = menubar->add_menu("Go");
|
||||
|
|
Loading…
Reference in a new issue