From 2375e1bcdac19f01712db97ba272493170bfc837 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 5 Jan 2022 17:03:49 +0100 Subject: [PATCH] LibGUI: Rename ModelSelection::remove_matching => remove_all_matching Let's be consistent with how Vector, HashTable and HashMap names these. --- Userland/Libraries/LibGUI/AbstractView.cpp | 2 +- Userland/Libraries/LibGUI/FileSystemModel.cpp | 2 +- Userland/Libraries/LibGUI/ModelSelection.cpp | 2 +- Userland/Libraries/LibGUI/ModelSelection.h | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibGUI/AbstractView.cpp b/Userland/Libraries/LibGUI/AbstractView.cpp index 2b4da3728b0..2b0af648c52 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 2668f4c7bb1..e74f90bcebe 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 5bc4a1b1a7d..1aa22a3d640 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 8b6ed047104..85305246beb 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)