From 82bcb1767c8ca1fdecc2bc40eb3a47fc1bd2a147 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Mon, 21 Jul 2014 18:54:28 -0300 Subject: Don't plot pictures in Print mode The pictures were being plotted in print mode, the main reason for this was that when we entered print mode and had already a picture plotted, the method would return before removing them from the screen. This fixes it. Signed-off-by: Tomaz Canabrava Signed-off-by: Dirk Hohndel --- qt-ui/profile/profilewidget2.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'qt-ui/profile') diff --git a/qt-ui/profile/profilewidget2.cpp b/qt-ui/profile/profilewidget2.cpp index 7157f5385..5e9a1d8c5 100644 --- a/qt-ui/profile/profilewidget2.cpp +++ b/qt-ui/profile/profilewidget2.cpp @@ -527,6 +527,8 @@ void ProfileWidget2::plotDive(struct dive *d, bool force) DivePlannerPointsModel *model = DivePlannerPointsModel::instance(); model->deleteTemporaryPlan(); } + plotPictures(); + // OK, how long did this take us? Anything above the second is way too long, // so if we are calculation TTS / NDL then let's force that off. if (measureDuration.elapsed() > 1000 && prefs.calcndltts) { @@ -1356,11 +1358,12 @@ void ProfileWidget2::keyEscAction() void ProfileWidget2::plotPictures() { + qDeleteAll(pictures); + pictures.clear(); + if (printMode) return; - qDeleteAll(pictures); - pictures.clear(); double x, y, lastX = -1.0, lastY = -1.0; DivePictureModel *m = DivePictureModel::instance(); for (int i = 0; i < m->rowCount(); i++) { -- cgit v1.2.3-70-g09d2