summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSilarn <jrim@rimpo.org>2019-12-08 16:15:40 -0600
committerSilarn <jrim@rimpo.org>2019-12-08 16:16:10 -0600
commitdf54f972fff57a7c7afe8dfb44efda43d76e8c78 (patch)
treee06084b340d4331ecd5665038a383fb1e719b6fe /src
parent8c3a3e8257e63328298c91c71740ac3a550b70d6 (diff)
Rework logic to parse by visual index
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp12
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;
}
}