diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 2b4da3728b..2b0af648c5 100644 --- a/Userland/Libraries/LibGUI/AbstractView.cpp +++ b/Userland/Libraries/LibGUI/AbstractView.cpp @@ -71,7 +71,7 @@ void AbstractView::model_did_update(unsigned int flags) m_cursor_index = {}; if (!model()->is_within_range(m_drop_candidate_index)) m_drop_candidate_index = {}; - selection().remove_matching([this](auto& index) { return !model()->is_within_range(index); }); + selection().remove_all_matching([this](auto& index) { return !model()->is_within_range(index); }); auto index = find_next_search_match(m_highlighted_search.view()); if (index.is_valid()) diff --git a/Userland/Libraries/LibGUI/FileSystemModel.cpp b/Userland/Libraries/LibGUI/FileSystemModel.cpp index 2668f4c7bb..e74f90bceb 100644 --- a/Userland/Libraries/LibGUI/FileSystemModel.cpp +++ b/Userland/Libraries/LibGUI/FileSystemModel.cpp @@ -423,7 +423,7 @@ void FileSystemModel::handle_file_event(Core::FileWatcherEvent const& event) end_delete_rows(); for_each_view([&](AbstractView& view) { - view.selection().remove_matching([&](auto& selection_index) { + view.selection().remove_all_matching([&](auto& selection_index) { return selection_index.internal_data() == index.internal_data(); }); if (view.cursor_index().internal_data() == index.internal_data()) { diff --git a/Userland/Libraries/LibGUI/ModelSelection.cpp b/Userland/Libraries/LibGUI/ModelSelection.cpp index 5bc4a1b1a7..1aa22a3d64 100644 --- a/Userland/Libraries/LibGUI/ModelSelection.cpp +++ b/Userland/Libraries/LibGUI/ModelSelection.cpp @@ -10,7 +10,7 @@ namespace GUI { -void ModelSelection::remove_matching(Function filter) +void ModelSelection::remove_all_matching(Function filter) { if (m_indices.remove_all_matching([&](ModelIndex const& index) { return filter(index); })) notify_selection_changed(); diff --git a/Userland/Libraries/LibGUI/ModelSelection.h b/Userland/Libraries/LibGUI/ModelSelection.h index 8b6ed04710..85305246be 100644 --- a/Userland/Libraries/LibGUI/ModelSelection.h +++ b/Userland/Libraries/LibGUI/ModelSelection.h @@ -76,7 +76,7 @@ public: return *m_indices.begin(); } - void remove_matching(Function); + void remove_all_matching(Function filter); template void change_from_model(Badge, Function f)