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

LibGUI: Remove Model::sibling() since it's the same as index()

... I'm not sure what the idea was here, but since these functions do
the same thing, let's only have index().
This commit is contained in:
Andreas Kling 2020-08-13 16:07:58 +02:00
parent fe19cf0ff2
commit 4088beb8eb
5 changed files with 4 additions and 15 deletions

View file

@ -289,7 +289,7 @@ void ColumnsView::keydown_event(KeyEvent& event)
auto old_index = selection().first();
auto parent_index = model.parent_index(old_index);
int row = old_index.row() > 0 ? old_index.row() - 1 : 0;
new_index = model.sibling(row, old_index.column(), parent_index);
new_index = model.index(row, old_index.column(), parent_index);
} else {
new_index = model.index(0, m_model_column, {});
}
@ -306,7 +306,7 @@ void ColumnsView::keydown_event(KeyEvent& event)
auto old_index = selection().first();
auto parent_index = model.parent_index(old_index);
int row = old_index.row() + 1;
new_index = model.sibling(row, old_index.column(), parent_index);
new_index = model.index(row, old_index.column(), parent_index);
} else {
new_index = model.index(0, m_model_column, {});
}