diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-04-27 20:47:47 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-04-27 20:47:47 -0700 |
commit | 4bb0cd8cef2bbbbe3df6fc3daa9ccca95f065038 (patch) | |
tree | c0f193d30f1abd945581e3d04bd57a8d374018f3 /qt-ui | |
parent | 89f02c42aa2fb49a811cb6e31dd40cd56dee0cf9 (diff) | |
download | subsurface-4bb0cd8cef2bbbbe3df6fc3daa9ccca95f065038.tar.gz |
Minor coding style cleanups - and use core logic function
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/mainwindow.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/qt-ui/mainwindow.cpp b/qt-ui/mainwindow.cpp index 0c6691a06..d20f8cfb6 100644 --- a/qt-ui/mainwindow.cpp +++ b/qt-ui/mainwindow.cpp @@ -44,9 +44,8 @@ void MainWindow::on_actionNew_triggered() void MainWindow::on_actionOpen_triggered() { QString filename = QFileDialog::getOpenFileName(this, tr("Open File"), QDir::homePath(), filter()); - if (filename.isEmpty()) { + if (filename.isEmpty()) return; - } // Needed to convert to char* QByteArray fileNamePtr = filename.toLocal8Bit(); @@ -57,15 +56,13 @@ void MainWindow::on_actionOpen_triggered() parse_file(fileNamePtr.data(), &error); set_filename(fileNamePtr.data(), TRUE); - if (error != NULL) - { + if (error != NULL) { QMessageBox::warning(this, "Error", error->message); g_error_free(error); error = NULL; } - //WARNING: Port This method to Qt - report_dives(FALSE, FALSE); + process_dives(FALSE, FALSE); ui->InfoWidget->reload(); @@ -86,15 +83,12 @@ void MainWindow::on_actionSaveAs_triggered() void MainWindow::on_actionClose_triggered() { if (unsaved_changes() && (askSaveChanges() == FALSE)) - { return; - } /* free the dives and trips */ while (dive_table.nr) - { delete_single_dive(0); - } + mark_divelist_changed(FALSE); /* clear the selection and the statistics */ @@ -142,10 +136,7 @@ void MainWindow::on_actionQuit_triggered() { qDebug("actionQuit"); if (unsaved_changes() && (askSaveChanges() == FALSE)) - { return; - } - } void MainWindow::on_actionDownloadDC_triggered() @@ -313,11 +304,10 @@ void MainWindow::writeSettings() void MainWindow::closeEvent(QCloseEvent *event) { - if (unsaved_changes() && (askSaveChanges() == FALSE)) - { + if (unsaved_changes() && (askSaveChanges() == FALSE)) { event->ignore(); return; } event->accept(); writeSettings(); -}
\ No newline at end of file +} |