summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-17 10:57:24 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-08-17 10:57:24 -0700
commitd0e27c6c533005b5fd161286f68f1325bdabe8e3 (patch)
tree37d7fe231cd6c9e8d4acc7bba243b9fd456f70c1 /dive.c
parent589589c707262920a4c9ffc258704e30fa62b8fa (diff)
parent549708c6eaab2d0592c3e520e0debd82d64619b4 (diff)
downloadsubsurface-d0e27c6c533005b5fd161286f68f1325bdabe8e3.tar.gz
Merge branch 'misc-fixes' of git://github.com/DataBeaver/subsurface
Pull miscellaneous fixes, mostly UI stuff from Mikko Rasa. Both this and the pull from Pierre-Yves Chibon created a "Save As" menu entry and logic. As a result, there were a fair number of conflicts, but I tried to make the end result somewhat reasonable. I might have missed some semantic conflict, though. Series-acked-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> * 'misc-fixes' of git://github.com/DataBeaver/subsurface: Add a separate "Save as" entry to the menu Changes to menu icons Improved depth info for dives without samples Divide the panes evenly in view_three
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index f5d082801..f4bf497a7 100644
--- a/dive.c
+++ b/dive.c
@@ -473,7 +473,12 @@ struct dive *fixup_dive(struct dive *dive)
}
}
if (end < 0)
+ {
+ /* Assume an ascent/descent rate of 9 m/min */
+ int asc_desc_time = dive->maxdepth.mm*60/9000;
+ dive->meandepth.mm = dive->maxdepth.mm*(dive->duration.seconds-asc_desc_time)/dive->duration.seconds;
return dive;
+ }
update_duration(&dive->duration, end - start);
if (start != end)