From df54f972fff57a7c7afe8dfb44efda43d76e8c78 Mon Sep 17 00:00:00 2001 From: Silarn Date: Sun, 8 Dec 2019 16:15:40 -0600 Subject: Rework logic to parse by visual index --- src/mainwindow.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 43d5b820..274e07c1 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2310,9 +2310,9 @@ void MainWindow::processUpdates(Settings& settings) { if (!settings.firstStart()) { if (lastVersion < QVersionNumber(2, 1, 3)) { bool lastHidden = true; - for (int i = ModList::COL_GAME; i < ui->modList->model()->columnCount(); ++i) { - bool hidden = ui->modList->header()->isSectionHidden(i); - ui->modList->header()->setSectionHidden(i, lastHidden); + for (int i = ui->modList->header()->visualIndex(ModList::COL_GAME); i < ui->modList->header()->count(); ++i) { + bool hidden = ui->modList->header()->isSectionHidden(ui->modList->header()->logicalIndex(i)); + ui->modList->header()->setSectionHidden(ui->modList->header()->logicalIndex(i), lastHidden); lastHidden = hidden; } } @@ -2330,9 +2330,9 @@ void MainWindow::processUpdates(Settings& settings) { if (lastVersion < QVersionNumber(2, 2, 2)) { bool lastHidden = true; - for (int i = ModList::COL_CONFLICTFLAGS; i < ui->modList->model()->columnCount(); ++i) { - bool hidden = ui->modList->header()->isSectionHidden(i); - ui->modList->header()->setSectionHidden(i, lastHidden); + for (int i = ui->modList->header()->visualIndex(ModList::COL_CONFLICTFLAGS); i < ui->modList->header()->count(); ++i) { + bool hidden = ui->modList->header()->isSectionHidden(ui->modList->header()->logicalIndex(i)); + ui->modList->header()->setSectionHidden(ui->modList->header()->logicalIndex(i), lastHidden); lastHidden = hidden; } } -- cgit v1.3.1