Explorar o código

FileManager: Don't show new dotfiles if the option is disabled

offtkp %!s(int64=3) %!d(string=hai) anos
pai
achega
d24ec130bf
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Userland/Libraries/LibGUI/FileSystemModel.cpp

+ 2 - 0
Userland/Libraries/LibGUI/FileSystemModel.cpp

@@ -384,6 +384,8 @@ void FileSystemModel::handle_file_event(Core::FileWatcherEvent const& event)
         LexicalPath path { event.event_path };
         LexicalPath path { event.event_path };
         auto& parts = path.parts_view();
         auto& parts = path.parts_view();
         StringView child_name = parts.last();
         StringView child_name = parts.last();
+        if (!m_should_show_dotfiles && child_name.starts_with("."))
+            break;
 
 
         auto parent_name = path.parent().string();
         auto parent_name = path.parent().string();
         auto parent = node_for_path(parent_name);
         auto parent = node_for_path(parent_name);