Qt: Fix incorrect sort indicator on loading

This commit is contained in:
Stenzek 2024-07-09 21:29:48 +10:00
parent 93836636a1
commit a56ebf24b2
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -640,7 +640,10 @@ void GameListWidget::loadTableViewColumnSortSettings()
.value_or(DEFAULT_SORT_COLUMN);
const bool sort_descending =
Host::GetBaseBoolSettingValue("GameListTableView", "SortDescending", DEFAULT_SORT_DESCENDING);
m_sort_model->sort(sort_column, sort_descending ? Qt::DescendingOrder : Qt::AscendingOrder);
const Qt::SortOrder sort_order = sort_descending ? Qt::DescendingOrder : Qt::AscendingOrder;
m_sort_model->sort(sort_column, sort_order);
if (QHeaderView* hv = m_table_view->horizontalHeader())
hv->setSortIndicator(sort_column, sort_order);
}
void GameListWidget::saveTableViewColumnSortSettings()