mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibGUI+Applications: Rename Model::is_valid to is_within_range
The previous name did not describe what the function checked, and was easy to confuse with ModelIndex::is_valid.
This commit is contained in:
parent
9899addb1d
commit
16ac3bbfd7
8 changed files with 18 additions and 18 deletions
|
@ -141,7 +141,7 @@ void AutocompleteBox::next_suggestion()
|
|||
else
|
||||
new_index = m_suggestion_view->model()->index(0);
|
||||
|
||||
if (m_suggestion_view->model()->is_valid(new_index)) {
|
||||
if (m_suggestion_view->model()->is_within_range(new_index)) {
|
||||
m_suggestion_view->selection().set(new_index);
|
||||
m_suggestion_view->scroll_into_view(new_index, Orientation::Vertical);
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ void AutocompleteBox::previous_suggestion()
|
|||
else
|
||||
new_index = m_suggestion_view->model()->index(0);
|
||||
|
||||
if (m_suggestion_view->model()->is_valid(new_index)) {
|
||||
if (m_suggestion_view->model()->is_within_range(new_index)) {
|
||||
m_suggestion_view->selection().set(new_index);
|
||||
m_suggestion_view->scroll_into_view(new_index, Orientation::Vertical);
|
||||
}
|
||||
|
@ -170,7 +170,7 @@ void AutocompleteBox::apply_suggestion()
|
|||
return;
|
||||
|
||||
auto selected_index = m_suggestion_view->selection().first();
|
||||
if (!selected_index.is_valid() || !m_suggestion_view->model()->is_valid(selected_index))
|
||||
if (!selected_index.is_valid() || !m_suggestion_view->model()->is_within_range(selected_index))
|
||||
return;
|
||||
|
||||
auto suggestion_index = m_suggestion_view->model()->index(selected_index.row(), AutocompleteSuggestionModel::Column::Name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue