summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGUI/SortingProxyModel.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-04-29 22:23:52 +0200
committerAndreas Kling <kling@serenityos.org>2021-04-29 22:23:52 +0200
commit3d4afe7614bf8ff4c6fe141d1dcd83688a7ac8cd (patch)
treeb27345e76b10d2cd7c4381a70385c21d6310405a /Userland/Libraries/LibGUI/SortingProxyModel.cpp
parent7ae7170d6140f7cad730f05f84b53437058b82f4 (diff)
downloadserenity-3d4afe7614bf8ff4c6fe141d1dcd83688a7ac8cd.zip
Everywhere: "indexes" => "indices"
I've wasted a silly amount of time in the past fretting over which of these words to use. Let's just choose one and use it everywhere. :^)
Diffstat (limited to 'Userland/Libraries/LibGUI/SortingProxyModel.cpp')
-rw-r--r--Userland/Libraries/LibGUI/SortingProxyModel.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/Userland/Libraries/LibGUI/SortingProxyModel.cpp b/Userland/Libraries/LibGUI/SortingProxyModel.cpp
index f1feae9b72..7ae72e907e 100644
--- a/Userland/Libraries/LibGUI/SortingProxyModel.cpp
+++ b/Userland/Libraries/LibGUI/SortingProxyModel.cpp
@@ -24,7 +24,7 @@ SortingProxyModel::~SortingProxyModel()
void SortingProxyModel::invalidate(unsigned int flags)
{
- if (flags == UpdateFlag::DontInvalidateIndexes) {
+ if (flags == UpdateFlag::DontInvalidateIndices) {
sort(m_last_key_column, m_last_sort_order);
} else {
m_mappings.clear();
@@ -201,20 +201,20 @@ void SortingProxyModel::sort_mapping(Mapping& mapping, int column, SortOrder sor
// Update the view's selection.
view.selection().change_from_model({}, [&](ModelSelection& selection) {
- Vector<ModelIndex> selected_indexes_in_source;
- Vector<ModelIndex> stale_indexes_in_selection;
+ Vector<ModelIndex> selected_indices_in_source;
+ Vector<ModelIndex> stale_indices_in_selection;
selection.for_each_index([&](const ModelIndex& index) {
if (index.parent() == mapping.source_parent) {
- stale_indexes_in_selection.append(index);
- selected_indexes_in_source.append(source().index(old_source_rows[index.row()], index.column(), mapping.source_parent));
+ stale_indices_in_selection.append(index);
+ selected_indices_in_source.append(source().index(old_source_rows[index.row()], index.column(), mapping.source_parent));
}
});
- for (auto& index : stale_indexes_in_selection) {
+ for (auto& index : stale_indices_in_selection) {
selection.remove(index);
}
- for (auto& index : selected_indexes_in_source) {
+ for (auto& index : selected_indices_in_source) {
for (size_t i = 0; i < mapping.source_rows.size(); ++i) {
if (mapping.source_rows[i] == index.row()) {
auto new_source_index = this->index(i, index.column(), mapping.source_parent);
@@ -237,7 +237,7 @@ void SortingProxyModel::sort(int column, SortOrder sort_order)
m_last_key_column = column;
m_last_sort_order = sort_order;
- did_update(UpdateFlag::DontInvalidateIndexes);
+ did_update(UpdateFlag::DontInvalidateIndices);
}
SortingProxyModel::InternalMapIterator SortingProxyModel::build_mapping(const ModelIndex& source_parent)
@@ -287,10 +287,10 @@ bool SortingProxyModel::is_searchable() const
Vector<ModelIndex, 1> SortingProxyModel::matches(const StringView& searching, unsigned flags, const ModelIndex& proxy_index)
{
- auto found_indexes = source().matches(searching, flags, map_to_source(proxy_index));
- for (size_t i = 0; i < found_indexes.size(); i++)
- found_indexes[i] = map_to_proxy(found_indexes[i]);
- return found_indexes;
+ auto found_indices = source().matches(searching, flags, map_to_source(proxy_index));
+ for (size_t i = 0; i < found_indices.size(); i++)
+ found_indices[i] = map_to_proxy(found_indices[i]);
+ return found_indices;
}
}