Some DCs only report water type, without salinity level. Subsurface
fixes most of these cases using default levels, but when the type of water
is Sea/Salt, this fix was not saved.
This causes a bit confusion, mainly if the user defines own salinity level.
Signed-off-by: Rafael M. Salvioni <rafael.salvioni@gmail.com>
Fix a bug causing the bluetooth address not being used when downloading
from a 'remembered' dive computer if the device selection is populated.
This specifically excludes MacOS, as 'remembering' bluetooth connections
does not seem to be working there as per
https://github.com/subsurface/subsurface/pull/2158#issuecomment-508933672.
I am not super sure why we are _not_ trying to use the 'remembered'
device if the device selection is populated (`ui.device->currentIndex()
== -1`) - maybe this should be clarified in a comment?
Signed-off-by: Michael Keller <github@ike.ch>
Since the only caller was C++ code, this can be done in
C++ code, which removes memory-management headaches.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Make the time edit respect the configured time format. Also make the
date and time format change when the preferences are changed.
Fixes#3849.
Signed-off-by: Michael Keller <github@ike.ch>
Add titles for the individual topics covered in CONTRIBUTING.md. One
advantage of this is that it makes it possible to link to individual
topics when providing feedback on pull requests.
Signed-off-by: Michael Keller <github@ike.ch>
Format keywords, classes, string examples, etc. in prose of
CODINGSTYLE.md using `inline formatting` with single backticks.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Similarly to commit 062533d0a (CONTRIBUTING.md: use dashes instead of
hyphens, 2023-01-14), replace hyphens in prose of CODINGSTYLE.md with
dashes to make the rendered Markdown a bit nicer.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
The `for` loop in the sample iterates over `serviceUuids`, but the only
other statement in the sample assigns variable named `l`. Fix the name
of the variable in the assignment to be the same as in the loop.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Without an blank line, the pseudo-headers of list items are not
separated from the next paragraph. An example is rendered as:
* variable declarations In C code we really ...
instead of intended:
* variable declarations
In C code we really ...
Add missing blank lines between paragraphs inside list items and in
between list items to fix the intended rendering.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
Samples of code in CODINGSTYLE.md are wrapped in triple-backticks to
render them as blocks of code. For code blocks that are indented within
a list item, Markdown renderer of GitHub treats the leading tab as if it
was four spaces. Rendered code blocks are formatted in a way that
contradicts the code style written down in prose.
Replace leading tabs in indentation with spaces in blocks of sample code
to render them correctly in Markdown lists.
Signed-off-by: Andrei Rybak <rybak.a.v@gmail.com>
In order to support development of the open source firmware of the
OSTC4.
Requires changes in libdivecomputer.
Signed-off-by: Michael Keller <github@ike.ch>
Fix a bug causing the wrong units (m) to be shown on the Dive site
management view if imperial units are as the system default.
Signed-off-by: Michael Keller <github@ike.ch>
Disable the 'search dive computer' ([...]]) button in the 'Import from
dive computer' window if searching is not supported by the currently
selected vendor.
Signed-off-by: Michael Keller <github@ike.ch>
Fixes a bug reported in
https://groups.google.com/g/subsurface-divelog/c/8N3cTz2Zv5E:
When planning a CCR dive with multiple segments, the textual dive plan
was showing a non-existent gas change with bogus data. The first part
of the fix is uncluttering of the message printed: Since this change is
_after_ the current diveplanpoint the data needs to come from `nextdp`
and not `dp`. The second part is that the message is not printed any
more if the current and the following segments have been manually added:
According to comments in the code the change should only be printed on
the segment _before_ the change if this segment is an ascent segment
that is followed by a manually entered segment.
Signed-off-by: Michael Keller <github@ike.ch>
Fix a bug that results in dive plans outside of the configured risk
profile being produced when planning a CCR dive with the first segment
set to open circuit.
`d->dc.divemode` is already set in `setRebreatherMode`, which is
sufficient, and congruent with the setting of other dive parameters,
like `diveplan.gflow`.
Signed-off-by: Michael Keller <github@ike.ch>
Merge upstream updates from Jef Driesen:
- Deepblu Cosmiq+ support has been merged upstream
- Oceans S1 support has been merged upstream
- Various new models supported: Cressi Donatello, Scubapro G2 TEK, new
Excursion v6+ firmware.
- misc core changes, most notably supporting a new annoying specialized
binary format for decomode, because Jef still can't deal with
strings.
- lots of small details
(all the work done by Linus - I'm just adding this to Surface)
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
With Qt-containers, this might be a small pessimization, because
it might lead to a deep copy. This can be "fixed" by
for (const Type &item: qAsConst(container))
But frankly, I don't care. Ultimately it is probably best to
replace the Qt containers by standard containers.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The event names were registered in add_event(). However,
the undo system did not use that function, but add_event_to_dc(),
which takes an already allocated event.
That gave the following unfortunate situation:
Load a log without setpoint changes.
Add a setpoint change.
The setpoint change event type now was not registered and
therefore couldn't be hidden.
Admittedly, a subtle bug, but still a bug. Fix by registering
event names on event creation.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The eventname handling code was splattered all over the place.
Collect it in a single source file and use C++ idioms to avoid
nasty memory management. Provide a C-only interface, however.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Changed the way dive data points for OC cylinders to be added to the
dive plan are created in `createTemporaryPlan()` in
`diveplannermodel.cpp`. This now uses `plan_add_segment()` like all
other places where dive data points are added, in particular the planner
tests.
This also allowed for `create_dp()` to be made static.
Signed-off-by: Michael Keller <github@ike.ch>
Fixes a bug reported in
https://groups.google.com/g/subsurface-divelog/c/8N3cTz2Zv5E:
When planning a CCR dive with OC bailout, the diluent gas may be chosen
as the first OC bailout gas, despite being set up with a use type of
'diluent', and likely not being available for open circuit breathing.
`best_first_ascend_cylinder` is now initialised to an invalid value
(instead of the first cylinder, which may or may not be a diluent
cylinder), and its subsequent use is guarded by a validity check.
Signed-off-by: Michael Keller <github@ike.ch>
3629a87 changed the handling of cylinders in multi-dives edit.
Not only should the cylinders be the "same", but also at the
same position. The code did not check whether the edited dives
even had that many cylinders, leading to a null-pointer
dereference.
Check whether the cylinder exists before comparing it.
Fixes#3578.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Change the values supplied in the warning to be fractions. This is what
is actually reported by libdivecomputer. The currently used thousandths
are hard to interpret for users, as they are only used internally in
Subsurface.
Signed-off-by: Michael Keller <github@ike.ch>