1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:38:10 +00:00

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. :^)
This commit is contained in:
Andreas Kling 2021-04-29 22:23:52 +02:00
parent 7ae7170d61
commit 3d4afe7614
29 changed files with 139 additions and 139 deletions

View file

@ -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;
}
}