Hi,
I could not reproduce that behavior. But looking at the code, there might be the case that there is a current dive but that that dive does not have any cylinder. Here is a patch that is supposed to catch that case and add a default cylinder instead. Could you please test that this patch solves this problem? There is a second patch that adds a recently added dependency to the INSTALL file (I could not build without it).
|
From 2a76a39b14b8edfbe36fb0fa3b2c34e6807d7295 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" <[email protected]> Date: Tue, 20 Oct 2015 09:39:27 +0200 Subject: [PATCH 1/2] Mention hidapi in Mac building instructions
Add it to the list of homebrew packages. Signed-off-by: Robert C. Helling <[email protected]> --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 19f6f49..4d5b76e 100644 --- a/INSTALL +++ b/INSTALL @@ -161,7 +161,7 @@ $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/maste 2) Install needed dependencies -$ brew install asciidoc libzip sqlite cmake libusb pkg-config automake libtool +$ brew install asciidoc libzip sqlite cmake libusb pkg-config automake libtool hidapi 3) Make the brew version of sqlite the default -- 2.3.8 (Apple Git-58)
From 3faf027d3cd9fca7d5706ed94a88798a823de57e Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" <[email protected]> Date: Tue, 20 Oct 2015 09:56:01 +0200 Subject: [PATCH 2/2] Always make sure the planner starts with at least one cylinder void DivePlannerPointsModel::setupCylinders() in diveplannermodel.cpp handles setting up cylinders for the planner. If there is a current dive, cylinders form that dive are copied. Otherwise the default cylinder is added and lacking that a standard size cylinder. If the current dive does not have any cylinders, we could end up without cylinders. This patch adds a test for this case and delegates to the other two sources of a cylinder in that case. Signed-off-by: Robert C. Helling <[email protected]> --- qt-models/diveplannermodel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qt-models/diveplannermodel.cpp b/qt-models/diveplannermodel.cpp index b5db3f0..6556db5 100644 --- a/qt-models/diveplannermodel.cpp +++ b/qt-models/diveplannermodel.cpp @@ -115,12 +115,16 @@ void DivePlannerPointsModel::loadFromDive(dive *d) // setup the cylinder widget accordingly void DivePlannerPointsModel::setupCylinders() { + int i; if (mode == PLAN && current_dive) { // take the displayed cylinders from the selected dive as starting point CylindersModel::instance()->copyFromDive(current_dive); copy_cylinders(current_dive, &displayed_dive, !prefs.display_unused_tanks); reset_cylinders(&displayed_dive, true); - return; + + for (i = 0; i < MAX_CYLINDERS; i++) + if (!cylinder_none(&(displayed_dive.cylinder[i]))) + return; // We have at least one cylinder } if (!same_string(prefs.default_cylinder, "")) { fill_default_cylinder(&displayed_dive.cylinder[0]); -- 2.3.8 (Apple Git-58)
Best Robert -- .oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oOo.oO Robert C. Helling Elite Master Course Theoretical and Mathematical Physics Scientific Coordinator Ludwig Maximilians Universitaet Muenchen, Dept. Physik Phone: +49 89 2180-4523 Theresienstr. 39, rm. B339 http://www.atdotde.de Enhance your privacy, use cryptography! My PGP keys have fingerprints A9D1 A01D 13A5 31FA 6515 BB44 0820 367C 36BC 0C1D and DCED 37B6 251C 7861 270D 5613 95C7 9D32 9A8D 9B8F |
signature.asc
Description: Message signed with OpenPGP using GPGMail
_______________________________________________ subsurface mailing list [email protected] http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface
