summaryrefslogtreecommitdiffstats
path: root/profile-widget
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2020-04-27 21:42:48 +0200
committerGravatar Robert C. Helling <helling@atdotde.de>2020-04-27 22:19:31 +0200
commit142dc6f96fdfdef3132503a9e5f19944ea53325c (patch)
tree47d8b8c8eb1344488aca0d3e670498eb929d7dd8 /profile-widget
parent5ba7c68433f2ca62c840b038603ee404dbc1ccc9 (diff)
downloadsubsurface-142dc6f96fdfdef3132503a9e5f19944ea53325c.tar.gz
profile: set empty state when there is no current dive to show
The profile data was not properly cleared when not showing a dive. Fixes #2787 Reported-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Diffstat (limited to 'profile-widget')
-rw-r--r--profile-widget/profilewidget2.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/profile-widget/profilewidget2.cpp b/profile-widget/profilewidget2.cpp
index 7353cb14e..cd28a87bc 100644
--- a/profile-widget/profilewidget2.cpp
+++ b/profile-widget/profilewidget2.cpp
@@ -566,8 +566,10 @@ void ProfileWidget2::plotDive(const struct dive *d, bool force, bool doClearPict
#endif
if (currentState != ADD && currentState != PLAN) {
if (!d) {
- if (!current_dive)
+ if (!current_dive) {
+ setEmptyState();
return;
+ }
d = current_dive; // display the current dive
}