Qt: Fix incorrect sort indicator on loading

Backport from: a56ebf24b2
This commit is contained in:
KamFretoZ 2024-08-23 00:37:55 +07:00 committed by lightningterror
parent 973c522756
commit d1a7430f80
1 changed files with 4 additions and 1 deletions

View File

@ -537,7 +537,10 @@ void GameListWidget::loadTableViewColumnSortSettings()
.value_or(DEFAULT_SORT_COLUMN);
const bool sort_descending =
Host::GetBaseBoolSettingValue("GameListTableView", "SortDescending", DEFAULT_SORT_DESCENDING);
m_table_view->sortByColumn(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()