summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAL <26797547+Al12rs@users.noreply.github.com>2020-05-26 15:36:40 +0200
committerAL <26797547+Al12rs@users.noreply.github.com>2020-05-26 15:36:40 +0200
commit652d3ab054cd2bd94fe88dc42aa39798fc3b2c4a (patch)
tree06bed1cc1a3a01f2f40a2673b5c44d703ed23137
parenta721347fd130fcab19f2709892093f087bfac19e (diff)
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).
-rw-r--r--src/mainwindow.cpp3
1 files changed, 2 insertions, 1 deletions
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();