summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-11-08 20:30:17 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-11-09 15:32:37 +0900
commit7dbf76384f78b415250ec3de3090ea1ae68e3ac3 (patch)
tree041def1120191df9dc4e87d4cbcba901bddd4421 /qt-ui/mainwindow.cpp
parentba638cae05a3b285cd7a7f5790f9a3290eef7343 (diff)
downloadsubsurface-7dbf76384f78b415250ec3de3090ea1ae68e3ac3.tar.gz
Moved the code that handles DiveList column sizes to its correct file.
I got a bit lost trying to find the code that handled DiveList columns today, so I thought it was better to move it to its file, after all we do have a divelistview.h :) Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp22
1 files changed, 1 insertions, 21 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index 20c9384ba..643ad2e30 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -54,9 +54,9 @@ MainWindow::MainWindow() : helpView(0)
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ListWidget, SLOT(reloadHeaderActions()));
connect(PreferencesDialog::instance(), SIGNAL(settingsChanged()), ui.ProfileWidget, SLOT(refresh()));
ui.mainErrorMessage->hide();
- ui.ListWidget->reload(DiveTripModel::TREE);
initialUiSetup();
readSettings();
+ ui.ListWidget->reload(DiveTripModel::TREE);
ui.ListWidget->reloadHeaderActions();
ui.ListWidget->setFocus();
ui.globe->reload();
@@ -566,21 +566,6 @@ void MainWindow::initialUiSetup()
case PROFILE_MAXIMIZED : on_actionViewProfile_triggered(); break;
}
settings.endGroup();
- settings.beginGroup("ListWidget");
- /* if no width are set, use the calculated width for each column;
- * for that to work we need to temporarily expand all rows */
- ui.ListWidget->expandAll();
- for (i = DiveTripModel::NR; i < DiveTripModel::COLUMNS; i++) {
- QVariant width = settings.value(QString("colwidth%1").arg(i));
- if (width.isValid())
- ui.ListWidget->setColumnWidth(i, width.toInt());
- else
- ui.ListWidget->resizeColumnToContents(i);
- }
- ui.ListWidget->collapseAll();
- ui.ListWidget->expand(ui.ListWidget->model()->index(0,0));
- ui.ListWidget->scrollTo(ui.ListWidget->model()->index(0,0), QAbstractItemView::PositionAtCenter);
- settings.endGroup();
}
void MainWindow::readSettings()
@@ -652,11 +637,6 @@ void MainWindow::writeSettings()
}
settings.endGroup();
- settings.beginGroup("ListWidget");
- for (i = DiveTripModel::NR; i < DiveTripModel::COLUMNS; i++)
- if (!ui.ListWidget->isColumnHidden(i))
- settings.setValue(QString("colwidth%1").arg(i), ui.ListWidget->columnWidth(i));
- settings.endGroup();
settings.beginGroup("Units");
SAVE_VALUE("length", units.length);
SAVE_VALUE("pressure", units.pressure);