1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 12:27:34 +00:00

HackStudio: Keep the DeclarationsModel around, and use a filtering proxy

Rather than construct a new DeclarationsModel each time the user types
something in the Locator, keep a single one around permanently in the
ProjectDeclarations, and then use a FilteringProxyModel over it for the
suggestions.
This commit is contained in:
Sam Atkins 2024-01-25 14:19:15 +00:00 committed by Sam Atkins
parent e72b14ef1d
commit 85101c6626
6 changed files with 78 additions and 22 deletions

View file

@ -48,8 +48,10 @@ public:
virtual int column_count(GUI::ModelIndex const& = GUI::ModelIndex()) const override { return Column::__Column_Count; }
virtual GUI::Variant data(GUI::ModelIndex const& index, GUI::ModelRole role) const override;
virtual MatchResult data_matches(GUI::ModelIndex const&, GUI::Variant const&) const override;
Vector<Declaration> const& declarations() const { return m_declarations; }
void set_declarations(Vector<Declaration>&&);
private:
Vector<Declaration> m_declarations;