1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:37:35 +00:00

HackStudio: Make FindInFilesWidget reset when opening new project

Add method to FindInFilesWidget which resets the model in order to
clear the output when needed, and use this when a new project is opened.
This commit is contained in:
Lennon Donaghy 2021-08-02 19:26:20 +01:00 committed by Andreas Kling
parent ff2a1ee8b0
commit 5ca888132d
3 changed files with 7 additions and 0 deletions

View file

@ -148,5 +148,9 @@ void FindInFilesWidget::focus_textbox_and_select_all()
m_textbox->select_all(); m_textbox->select_all();
m_textbox->set_focus(true); m_textbox->set_focus(true);
} }
void FindInFilesWidget::reset()
{
m_result_view->set_model(nullptr);
}
} }

View file

@ -20,6 +20,8 @@ public:
void focus_textbox_and_select_all(); void focus_textbox_and_select_all();
void reset();
private: private:
explicit FindInFilesWidget(); explicit FindInFilesWidget();

View file

@ -199,6 +199,7 @@ void HackStudioWidget::open_project(const String& root_path)
m_open_files.clear(); m_open_files.clear();
m_open_files_vector.clear(); m_open_files_vector.clear();
add_new_editor(*m_editors_splitter); add_new_editor(*m_editors_splitter);
m_find_in_files_widget->reset();
m_todo_entries_widget->clear(); m_todo_entries_widget->clear();
m_terminal_wrapper->clear_including_history(); m_terminal_wrapper->clear_including_history();
stop_debugger_if_running(); stop_debugger_if_running();