1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 23:25:06 +00:00

LibGUI: Remove `AbstractView::did_update_model()'

...and use `ModelClient::model_did_update()' instead.
This makes AbstractView a ModelClient (which it always was anyway).
This commit is contained in:
AnotherTest 2020-11-26 11:10:14 +03:30 committed by Andreas Kling
parent 868c315e51
commit 71de8b7480
13 changed files with 26 additions and 23 deletions

View file

@ -40,11 +40,13 @@ Model::~Model()
void Model::register_view(Badge<AbstractView>, AbstractView& view)
{
m_views.set(&view);
m_clients.set(&view);
}
void Model::unregister_view(Badge<AbstractView>, AbstractView& view)
{
m_views.remove(&view);
m_clients.remove(&view);
}
void Model::for_each_view(Function<void(AbstractView&)> callback)
@ -57,10 +59,6 @@ void Model::did_update(unsigned flags)
{
for (auto* client : m_clients)
client->model_did_update(flags);
for_each_view([&](auto& view) {
view.did_update_model(flags);
});
}
ModelIndex Model::create_index(int row, int column, const void* data) const