From 652d3ab054cd2bd94fe88dc42aa39798fc3b2c4a Mon Sep 17 00:00:00 2001 From: AL <26797547+Al12rs@users.noreply.github.com> Date: Tue, 26 May 2020 15:36:40 +0200 Subject: Fix modlist scrolling to wrong location after filter refresh in some cases. If the currently selected column wasn't the Name column it would scroll to the first modnamee that matched the currently selected column contents (like scrolling to a mod called Audio overhaul after assigning Audio category to another mod). --- src/mainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index de4a6b39..971bb04d 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -5918,7 +5918,8 @@ void MainWindow::refreshFilters() { QItemSelection currentSelection = ui->modList->selectionModel()->selection(); - QVariant currentIndexName = ui->modList->currentIndex().data(); + int idxRow = ui->modList->currentIndex().row(); + QVariant currentIndexName = ui->modList->model()->index(idxRow, 0).data(); ui->modList->setCurrentIndex(QModelIndex()); m_Filters->refresh(); -- cgit v1.3.1