aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tomaz.canabrava@intel.com>2014-07-21 18:54:28 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-07-23 07:48:22 -0700
commit82bcb1767c8ca1fdecc2bc40eb3a47fc1bd2a147 (patch)
tree162f2d1dcf91c9935b27d2c4254572cdb2928fe2
parent5da2e667d0973ec1996aab40810bb2abc4c6bc3a (diff)
downloadsubsurface-82bcb1767c8ca1fdecc2bc40eb3a47fc1bd2a147.tar.gz
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 <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--qt-ui/profile/profilewidget2.cpp7
1 files changed, 5 insertions, 2 deletions
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++) {