summaryrefslogtreecommitdiffstats
path: root/qt-ui/mainwindow.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2013-11-01 09:43:41 -0400
committerGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2013-11-01 09:43:41 -0400
commitd9afcdc8cb0239d07b0578bbe2b4e4efe87c5958 (patch)
treed3421c811ea411d56e1025f97d23a601bb0592f7 /qt-ui/mainwindow.cpp
parent69d4ccae6db83173c2d87b2565852b530852c3cc (diff)
downloadsubsurface-d9afcdc8cb0239d07b0578bbe2b4e4efe87c5958.tar.gz
Code cleanup - Stop calling the same 6 lines everywhere.
There's a method named refreshDisplay, fairly unused, let's use it a bit mroe. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com>
Diffstat (limited to 'qt-ui/mainwindow.cpp')
-rw-r--r--qt-ui/mainwindow.cpp25
1 files changed, 4 insertions, 21 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp
index d797b0fe1..d2121e510 100644
--- a/qt-ui/mainwindow.cpp
+++ b/qt-ui/mainwindow.cpp
@@ -783,13 +783,7 @@ void MainWindow::importFiles(const QStringList fileNames)
}
}
process_dives(TRUE, FALSE);
-
- ui.InfoWidget->reload();
- ui.globe->reload();
- ui.ListWidget->reload(DiveTripModel::TREE);
- ui.ListWidget->setFocus();
- WSInfoModel *wsim = WSInfoModel::instance();
- wsim->updateInfo();
+ refreshDisplay();
}
void MainWindow::loadFiles(const QStringList fileNames)
@@ -814,25 +808,14 @@ void MainWindow::loadFiles(const QStringList fileNames)
process_dives(FALSE, FALSE);
- ui.InfoWidget->reload();
- ui.globe->reload();
- ui.ListWidget->reload(DiveTripModel::TREE);
- ui.ListWidget->setFocus();
- WSInfoModel *wsim = WSInfoModel::instance();
- wsim->updateInfo();
+ refreshDisplay();
ui.actionAutoGroup->setChecked(autogroup);
}
void MainWindow::on_actionImportCSV_triggered()
{
- CSVImportDialog *csvImport = new(CSVImportDialog);
+ CSVImportDialog *csvImport = new CSVImportDialog();
csvImport->show();
process_dives(TRUE, FALSE);
-
- ui.InfoWidget->reload();
- ui.globe->reload();
- ui.ListWidget->reload(DiveTripModel::TREE);
- ui.ListWidget->setFocus();
- WSInfoModel *wsim = WSInfoModel::instance();
- wsim->updateInfo();
+ refreshDisplay();
}