From d9afcdc8cb0239d07b0578bbe2b4e4efe87c5958 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Fri, 1 Nov 2013 09:43:41 -0400 Subject: 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 --- qt-ui/mainwindow.cpp | 25 ++++--------------------- 1 file 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(); } -- cgit v1.2.3-70-g09d2