summaryrefslogtreecommitdiffstats
path: root/main.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-18 16:56:28 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-02-18 17:00:18 -0800
commit6ce4d29f4907ec26486d9a16fee29edf1637b543 (patch)
tree494fbc383234f9f92445725f6694863995b19d7c /main.c
parentef55ddccb5bff1672e72947500c97fec51963358 (diff)
downloadsubsurface-6ce4d29f4907ec26486d9a16fee29edf1637b543.tar.gz
Clear statistics and equipment when no dive is selected
This all seems very strange forward. The reason for the check whether the stats_w widget has been populated is that at the very beginning, when the UI is still being assembled, a first call to switch_page() happens as the notebook pages are assembled. At that point the stats_w widget is still empty which tells us that we aren't ready to display anything. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'main.c')
-rw-r--r--main.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/main.c b/main.c
index 1ddcb3b64..fd5c78e82 100644
--- a/main.c
+++ b/main.c
@@ -247,10 +247,8 @@ void update_dive(struct dive *new_dive)
flush_divelist(old_dive);
}
show_dive_info(new_dive);
- if (new_dive) {
- show_dive_equipment(new_dive, W_IDX_PRIMARY);
- show_dive_stats(new_dive);
- }
+ show_dive_equipment(new_dive, W_IDX_PRIMARY);
+ show_dive_stats(new_dive);
buffered_dive = new_dive;
}