mirror of
https://github.com/RGBCube/serenity
synced 2025-05-20 18:15:07 +00:00
LibGUI: Add a ModelSelection::add_all(Vector) API
Using add() is very slow due to the change notifications.
This commit is contained in:
parent
b532b2d3ca
commit
169beff21e
2 changed files with 13 additions and 0 deletions
|
@ -64,6 +64,18 @@ void ModelSelection::add(const ModelIndex& index)
|
|||
notify_selection_changed();
|
||||
}
|
||||
|
||||
void ModelSelection::add_all(const Vector<ModelIndex>& indices)
|
||||
{
|
||||
{
|
||||
TemporaryChange notify_change { m_disable_notify, true };
|
||||
for (auto& index : indices)
|
||||
add(index);
|
||||
}
|
||||
|
||||
if (m_notify_pending)
|
||||
notify_selection_changed();
|
||||
}
|
||||
|
||||
void ModelSelection::toggle(const ModelIndex& index)
|
||||
{
|
||||
ASSERT(index.is_valid());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue