mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-03 23:25:20 +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:
@@ -122,7 +122,6 @@ public:
|
||||
virtual int column_count(const ModelIndex& = ModelIndex()) const override;
|
||||
virtual String column_name(int column) const override;
|
||||
virtual Variant data(const ModelIndex&, ModelRole = ModelRole::Display) const override;
|
||||
virtual void update() override;
|
||||
virtual ModelIndex parent_index(const ModelIndex&) const override;
|
||||
virtual ModelIndex index(int row, int column = 0, const ModelIndex& parent = ModelIndex()) const override;
|
||||
virtual StringView drag_data_type() const override { return "text/uri-list"; }
|
||||
@@ -132,6 +131,7 @@ public:
|
||||
virtual bool is_searchable() const override { return true; }
|
||||
virtual void set_data(const ModelIndex&, const Variant&) override;
|
||||
virtual Vector<ModelIndex, 1> matches(const StringView&, unsigned = MatchesFlag::AllMatching, const ModelIndex& = ModelIndex()) override;
|
||||
virtual void invalidate() override;
|
||||
|
||||
static String timestamp_string(time_t timestamp)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user