summaryrefslogtreecommitdiff
path: root/Applications/FileManager
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-08-12 20:27:23 +0200
committerAndreas Kling <kling@serenityos.org>2020-08-12 20:41:13 +0200
commit6caaa2bfdb0bf26050c132293b03647c46a070c6 (patch)
treeee1bdd5ac2c16bf431868f55f171017edfb37ef7 /Applications/FileManager
parentaae296ef08a8c03f82ec5a9baaa89633525221b6 (diff)
downloadserenity-6caaa2bfdb0bf26050c132293b03647c46a070c6.zip
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.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r--Applications/FileManager/DirectoryView.cpp5
-rw-r--r--Applications/FileManager/DirectoryView.h2
-rw-r--r--Applications/FileManager/main.cpp2
3 files changed, 8 insertions, 1 deletions
diff --git a/Applications/FileManager/DirectoryView.cpp b/Applications/FileManager/DirectoryView.cpp
index 0b3d83ec68..76e468a862 100644
--- a/Applications/FileManager/DirectoryView.cpp
+++ b/Applications/FileManager/DirectoryView.cpp
@@ -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);
+}
diff --git a/Applications/FileManager/DirectoryView.h b/Applications/FileManager/DirectoryView.h
index 9ff361eca2..389f5630bc 100644
--- a/Applications/FileManager/DirectoryView.h
+++ b/Applications/FileManager/DirectoryView.h
@@ -110,6 +110,8 @@ public:
callback(*m_columns_view);
}
+ void set_should_show_dotfiles(bool);
+
GUI::FileSystemModel& model() { return *m_model; }
private:
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp
index 0138c6be9a..ea2be2f849 100644
--- a/Applications/FileManager/main.cpp
+++ b/Applications/FileManager/main.cpp
@@ -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");