mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-23 11:04:40 +00:00
HackStudio: Clear ToDo entries upon opening new project
The ToDoEntries and ToDoEntriesWidget classes now have methods for clearing the entries, before entries would stay permanently, even after switching to a new project.
This commit is contained in:
parent
d48bd49002
commit
6076deae1d
|
@ -199,6 +199,7 @@ void HackStudioWidget::open_project(const String& root_path)
|
|||
m_open_files.clear();
|
||||
m_open_files_vector.clear();
|
||||
add_new_editor(*m_editors_splitter);
|
||||
m_todo_entries_widget->clear();
|
||||
}
|
||||
m_project = Project::open_with_root_path(root_path);
|
||||
VERIFY(m_project);
|
||||
|
|
|
@ -31,4 +31,9 @@ Vector<Cpp::Parser::TodoEntry> ToDoEntries::get_entries()
|
|||
return ret;
|
||||
}
|
||||
|
||||
void ToDoEntries::clear_entries()
|
||||
{
|
||||
m_document_to_entries.clear();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -24,6 +24,8 @@ public:
|
|||
|
||||
Vector<Cpp::Parser::TodoEntry> get_entries();
|
||||
|
||||
void clear_entries();
|
||||
|
||||
Function<void()> on_update = nullptr;
|
||||
|
||||
private:
|
||||
|
|
|
@ -91,6 +91,12 @@ void ToDoEntriesWidget::refresh()
|
|||
m_result_view->set_model(results_model);
|
||||
}
|
||||
|
||||
void ToDoEntriesWidget::clear()
|
||||
{
|
||||
ToDoEntries::the().clear_entries();
|
||||
refresh();
|
||||
}
|
||||
|
||||
ToDoEntriesWidget::ToDoEntriesWidget()
|
||||
{
|
||||
set_layout<GUI::VerticalBoxLayout>();
|
||||
|
|
|
@ -18,6 +18,8 @@ public:
|
|||
|
||||
void refresh();
|
||||
|
||||
void clear();
|
||||
|
||||
private:
|
||||
explicit ToDoEntriesWidget();
|
||||
|
||||
|
|
Loading…
Reference in a new issue