diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-17 18:59:50 -0300 |
---|---|---|
committer | Tomaz Canabrava <tcanabrava@kde.org> | 2013-06-17 18:59:50 -0300 |
commit | ae68ae38bbbc981aab4b8eaf1e84a15b8ab05bf4 (patch) | |
tree | 1b8cd2c26c573aa444f701ee0848a22d4ad1d8e0 /qt-ui/mainwindow.cpp | |
parent | 14ccbbf6e87b69267426ae69c402c1bae70ec5d5 (diff) | |
download | subsurface-ae68ae38bbbc981aab4b8eaf1e84a15b8ab05bf4.tar.gz |
Changed a lot of code to reduce boilerplate on models in the future.
So, I changed a lot of code to reduce boilerplate on models in the
future. Currently we do not have a lot of models, but this can increase
quite rapdly. There's a second TreeModel in the works, the Yearly
Statistics, this patch will save around 250 LOC for this new model,
and more and more models will give us a greater saving.
Iwll do that for the table models in the future too - I did the tree
models now because they are the most complex case and I didn't wanted
to create a second tree model without this.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r-- | qt-ui/mainwindow.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index f477a0d4f..45b8df80a 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -437,7 +437,7 @@ void MainWindow::initialUiSetup() /* 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 = TreeItemDT::NR; i < TreeItemDT::COLUMNS; i++) { + 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()); @@ -526,7 +526,7 @@ void MainWindow::writeSettings() settings.endGroup(); settings.beginGroup("ListWidget"); - for (i = TreeItemDT::NR; i < TreeItemDT::COLUMNS; i++) + 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(); |