diff options
| author | Silarn <jrim@rimpo.org> | 2019-12-08 16:15:40 -0600 |
|---|---|---|
| committer | Silarn <jrim@rimpo.org> | 2019-12-08 16:16:10 -0600 |
| commit | df54f972fff57a7c7afe8dfb44efda43d76e8c78 (patch) | |
| tree | e06084b340d4331ecd5665038a383fb1e719b6fe /src/mainwindow.cpp | |
| parent | 8c3a3e8257e63328298c91c71740ac3a550b70d6 (diff) | |
Rework logic to parse by visual index
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
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; } } |
