1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 07:37:35 +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

@ -343,7 +343,7 @@ DirectoryView::~DirectoryView()
void DirectoryView::model_did_update(unsigned flags)
{
if (flags & GUI::Model::UpdateFlag::InvalidateAllIndexes) {
if (flags & GUI::Model::UpdateFlag::InvalidateAllIndices) {
for_each_view_implementation([](auto& view) {
view.selection().clear();
});

View file

@ -152,7 +152,7 @@ void SheetModel::set_data(const GUI::ModelIndex& index, const GUI::Variant& valu
void SheetModel::update()
{
m_sheet->update();
did_update(UpdateFlag::DontInvalidateIndexes);
did_update(UpdateFlag::DontInvalidateIndices);
}
}

View file

@ -191,7 +191,7 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet)
m_table_view->on_selection_change = [&] {
m_sheet->selected_cells().clear();
for (auto& index : m_table_view->selection().indexes()) {
for (auto& index : m_table_view->selection().indices()) {
Position position { (size_t)index.column(), (size_t)index.row() };
m_sheet->selected_cells().set(position);
}
@ -201,7 +201,7 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet)
Vector<Position> selected_positions;
selected_positions.ensure_capacity(m_table_view->selection().size());
for (auto& selection : m_table_view->selection().indexes())
for (auto& selection : m_table_view->selection().indices())
selected_positions.empend((size_t)selection.column(), (size_t)selection.row());
if (on_selection_changed) {
@ -222,7 +222,7 @@ SpreadsheetView::SpreadsheetView(Sheet& sheet)
m_cell_range_context_menu = GUI::Menu::construct();
m_cell_range_context_menu->add_action(GUI::Action::create("Type and Formatting...", [this](auto&) {
Vector<Position> positions;
for (auto& index : m_table_view->selection().indexes()) {
for (auto& index : m_table_view->selection().indices()) {
Position position { (size_t)index.column(), (size_t)index.row() };
positions.append(move(position));
}
@ -295,7 +295,7 @@ void SpreadsheetView::show_event(GUI::ShowEvent&)
if (on_selection_changed && !m_table_view->selection().is_empty()) {
Vector<Position> selected_positions;
selected_positions.ensure_capacity(m_table_view->selection().size());
for (auto& selection : m_table_view->selection().indexes())
for (auto& selection : m_table_view->selection().indices())
selected_positions.empend((size_t)selection.column(), (size_t)selection.row());
on_selection_changed(move(selected_positions));

View file

@ -416,7 +416,7 @@ void ProcessModel::update()
if (on_state_update)
on_state_update(all_processes->size(), m_threads.size());
// FIXME: This is a rather hackish way of invalidating indexes.
// It would be good if GUI::Model had a way to orchestrate removal/insertion while preserving indexes.
did_update(previous_tid_count == m_tids.size() ? GUI::Model::UpdateFlag::DontInvalidateIndexes : GUI::Model::UpdateFlag::InvalidateAllIndexes);
// FIXME: This is a rather hackish way of invalidating indices.
// It would be good if GUI::Model had a way to orchestrate removal/insertion while preserving indices.
did_update(previous_tid_count == m_tids.size() ? GUI::Model::UpdateFlag::DontInvalidateIndices : GUI::Model::UpdateFlag::InvalidateAllIndices);
}

View file

@ -54,7 +54,7 @@ public:
virtual void update() override
{
did_update(GUI::Model::DontInvalidateIndexes);
did_update(GUI::Model::DontInvalidateIndices);
}
virtual void model_did_update([[maybe_unused]] unsigned flags) override