mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-30 05:08:56 +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:
@@ -21,7 +21,7 @@ public:
|
||||
virtual int column_count(const ModelIndex& = ModelIndex()) const override;
|
||||
virtual String column_name(int) const override;
|
||||
virtual Variant data(const ModelIndex&, ModelRole = ModelRole::Display) const override;
|
||||
virtual void update() override;
|
||||
virtual void invalidate() override;
|
||||
virtual StringView drag_data_type() const override;
|
||||
virtual ModelIndex parent_index(const ModelIndex&) const override;
|
||||
virtual ModelIndex index(int row, int column, const ModelIndex& parent) const override;
|
||||
@@ -63,7 +63,7 @@ private:
|
||||
Model& source() { return *m_source; }
|
||||
const Model& source() const { return *m_source; }
|
||||
|
||||
void invalidate(unsigned flags = Model::UpdateFlag::DontInvalidateIndices);
|
||||
void update_sort(unsigned = UpdateFlag::DontInvalidateIndices);
|
||||
InternalMapIterator build_mapping(const ModelIndex& proxy_index);
|
||||
|
||||
NonnullRefPtr<Model> m_source;
|
||||
|
||||
Reference in New Issue
Block a user