mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 18:28:12 +00:00
Everywhere: Replace Model::update() with Model::invalidate()
Most of the models were just calling did_update anyway, which is pointless since it can be unified to the base Model class. Instead, code calling update() will now call invalidate(), which functions identically and is more obvious in what it does. Additionally, a default implementation is provided, which removes the need to add empty implementations of update() for each model subclass. Co-Authored-By: Ali Mohammad Pur <ali.mpfard@gmail.com>
This commit is contained in:
parent
5cd2e0f3a2
commit
ca2c81251a
100 changed files with 116 additions and 261 deletions
|
@ -56,7 +56,7 @@ public:
|
|||
virtual String column_name(int) const { return {}; }
|
||||
virtual Variant data(const ModelIndex&, ModelRole = ModelRole::Display) const = 0;
|
||||
virtual TriState data_matches(const ModelIndex&, const Variant&) const { return TriState::Unknown; }
|
||||
virtual void update() = 0;
|
||||
virtual void invalidate();
|
||||
virtual ModelIndex parent_index(const ModelIndex&) const { return {}; }
|
||||
virtual ModelIndex index(int row, int column = 0, const ModelIndex& parent = ModelIndex()) const;
|
||||
virtual bool is_editable(const ModelIndex&) const { return false; }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue