1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:48:12 +00:00

LibGUI/AbstractView: Remove on_selection

Since the introduction of multi-select, we have had both `on_selection`
and `on_selection_change`, the latter of which was only invoked when a
change in selection came in through the model.

This removes `AbstractView::on_selection` and replaces it usage with
the more explicit `on_selection_change` everywhere.
This commit is contained in:
Jelle Raaijmakers 2021-05-25 22:48:43 +02:00 committed by Ali Mohammad Pur
parent ebe38639bc
commit 2c772d1848
12 changed files with 36 additions and 25 deletions

View file

@ -110,8 +110,8 @@ void AbstractView::did_update_selection()
{
if (!model() || selection().first() != m_edit_index)
stop_editing();
if (model() && on_selection && selection().first().is_valid())
on_selection(selection().first());
if (model() && on_selection_change)
on_selection_change();
}
void AbstractView::did_scroll()
@ -194,8 +194,6 @@ void AbstractView::activate_selected()
void AbstractView::notify_selection_changed(Badge<ModelSelection>)
{
did_update_selection();
if (on_selection_change)
on_selection_change();
if (!m_suppress_update_on_selection_change)
update();
}