summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/printer.cpp
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-13 13:45:52 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2020-05-03 14:47:49 -0700
commit17556cc66cedc84aaf6de2bfabcafbcca8bda53c (patch)
tree1f930db50cd8611d26fd006935f4f9abd1a8e97f /desktop-widgets/printer.cpp
parentc1963fd5ddd82b5ed0133ce6b04be9d525e27d89 (diff)
downloadsubsurface-17556cc66cedc84aaf6de2bfabcafbcca8bda53c.tar.gz
profile: don't interpret NULL as current_dive in plotDive()
ProfileWidget2::plotDive() had this weird interface, where passing in NULL as dive would mean "show current_dive". However, most callers would already pass in current_dive. Therefore, unify and always pass in current_dive if the caller wants to draw the current dive. This allows us to interpret NULL as "show empty profile". Thus, passing in current_dive when there is no current_dive simply shows an empty profile. This makes the calling code in MainWindow::selectionChanged() simpler. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'desktop-widgets/printer.cpp')
-rw-r--r--desktop-widgets/printer.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop-widgets/printer.cpp b/desktop-widgets/printer.cpp
index 9de1e41be..cd7c11345 100644
--- a/desktop-widgets/printer.cpp
+++ b/desktop-widgets/printer.cpp
@@ -185,7 +185,7 @@ void Printer::render(int Pages = 0)
qPrefDisplay::set_animation_speed(animationOriginal);
//replot the dive after returning the settings
- profile->plotDive(0, true, true);
+ profile->plotDive(current_dive, true, true);
}
//value: ranges from 0 : 100 and shows the progress of the templating engine