diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2020-04-13 14:46:15 +0200 |
---|---|---|
committer | Robert C. Helling <helling@atdotde.de> | 2020-05-04 10:42:07 +0200 |
commit | f123972dbf661c051c37387249ab5fb6d83e24fa (patch) | |
tree | f528dd5875cdc96e4c4e01259d2666575d6b527e /desktop-widgets/mainwindow.cpp | |
parent | 769915f3fe75bcef8029e82fdfed7ae206182390 (diff) | |
download | subsurface-f123972dbf661c051c37387249ab5fb6d83e24fa.tar.gz |
planner: update variations in planner not mainwindow
When calculating variations, they were sent to the mainwindow,
which updated displayed_dive accordingly. Do this directly
in the planner-model.
The idea is to detangle interdependencies and to make the
code reusable (planner on mobile?).
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index f3fee7ea5..1e893900b 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -206,7 +206,6 @@ MainWindow::MainWindow() : QMainWindow(), ui.menuFile->insertSeparator(ui.actionQuit); connect(DivePlannerPointsModel::instance(), SIGNAL(planCreated()), this, SLOT(planCreated())); connect(DivePlannerPointsModel::instance(), SIGNAL(planCanceled()), this, SLOT(planCanceled())); - connect(DivePlannerPointsModel::instance(), SIGNAL(variationsComputed(QString)), this, SLOT(updateVariations(QString))); connect(plannerDetails->printPlan(), SIGNAL(pressed()), divePlannerWidget, SLOT(printDecoPlan())); connect(this, &MainWindow::showError, ui.mainErrorMessage, &NotificationWidget::showError, Qt::AutoConnection); @@ -805,14 +804,6 @@ void MainWindow::setPlanNotes() plannerDetails->divePlanOutput()->setHtml(displayed_dive.notes); } -void MainWindow::updateVariations(QString variations) -{ - QString notes = QString(displayed_dive.notes); - free(displayed_dive.notes); - displayed_dive.notes = copy_qstring(notes.replace("VARIATIONS", variations)); - plannerDetails->divePlanOutput()->setHtml(displayed_dive.notes); -} - void MainWindow::printPlan() { #ifndef NO_PRINTING |