The roles DIVE_IDX and SELECTED_ROLE were used for the old selection
system and removed in b8e7a600d2.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
For reasons unknown to me, the profile test is executed with a
weird locale, resulting in wrong formatting.
By setting the locale manually to "C", the tests start to work.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
After the Mac QT upgrade to 5.15.13 google maps stopped working because a debug plugin was built and not deployed. This changes forces a release build. It may or may not be the best alternative, but if nothing else it's a starting point for discussion with people who know more about qmake than I do.
Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
- show the correct gasmix in the profile;
- make gases available for gas switches in the profile after they have
been added;
- persist gas changes;
- add air as a default gas when adding a dive.
This still has problems when undoing a gas switch - instead of
completely removing the gas switch it is just moved to the next point in the
profile.
Signed-off-by: Michael Keller <github@ike.ch>
testplan.cpp had a subtle bug since converting from a fixed-size
cylinder table to a dynamic cylinder table.
As noted in equipment.h, pointers to cylinders are *not* stable
when the cylinder table grows. Therefore, a construct such as
cylinder_t *cyl0 = get_or_create_cylinder(&dive, 0);
cylinder_t *cyl1 = get_or_create_cylinder(&dive, 1);
cylinder_t *cyl2 = get_or_create_cylinder(&dive, 2);
can give dangling cyl0 and cyl1 pointers. This was not an issue
with the old table code, since it had a rather liberal allocation
pattern. However, when switching to std::vector<>, the problem
becomes active.
To "fix" this, simply access the highest index first. Of course,
this should never be done in real code! Therefore, add a
comment at each instance.
Quickly checked all other get_or_create_cylinder() calls and
they seemed to be safe.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Add the gas description to the label on pressure graphs to disambiguate
if multiple identical gasmixes are shown.
Also move the label to the right, where the end pressures will typically
be more spread out than the starting pressures.
Signed-off-by: Michael Keller <mikeller@042.ch>
logfile_name was converted to std::string. Assigning a strdup()ed
string to it will leak memory.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The last use of these functions was removed in ae299d5e66.
And that's a good thing, because snprintf-style interfaces
make zero sense in times of variable-length character
encodings.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
A long standing issue: the dives_to_add, etc. tables need to be
manually freed. This kind of problem wouldn't arise with proper
C++ data structures.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
- standardise the naming;
- use it consistently;
- apply the 'samples < 50' only when putting manually added dives into
edit mode - everywhere else manually added dives should be treated as
such;
- do not show a warning before editing a manually added dive in planner.
Signed-off-by: Michael Keller <github@ike.ch>
Remove the workflow for building an ubuntu 14.04 Docker image. This is
no longer needed since the AppImage is now built on 16.04.
Signed-off-by: Michael Keller <github@ike.ch>
Improve the warning shown to the user when closing the application wile
in the planner. We now allow the user to directly discard the planned
dive, save it into the dive log, or cancel the operation altogether.
If they save into the dive log, or if they modified the dive log before
starting the planner, a second warning about the unsaved dive log
changes will be shown.
Signed-off-by: Michael Keller <mikeller@042.ch>
Suppress errors in the 'Add Artifact Comment' workflow if there are no
artifacts produced by the pull request workflow - this gets rid of
follow-on error messages when a pull request workflow encounters a build
error.
Signed-off-by: Michael Keller <mikeller@042.ch>
Error introduced in da7ea17b66: the INFO() and ERROR() macros
pass stdout instead of the format string as first parameter
to report_error(). Ooooops. How did this ever pass the
compile tests!?
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Make multiple improvements to the existing workflows:
- create a shared custom action to deal with version number tracking
and generation;
- use this action to add the branch name to the version for pull
request builds;
- create a shared workflow for all debian-ish builds to avoid re-use
by copy / paste;
- remove potential security risks by eliminating the use of
pre-evaluated expressions (`${{ ... }}`) inside scripts;
- update outdated GitHub action versions;
- improve the consistency by renaming scripts acording to have a `.sh`
extension;
- improve naming of generated artefacts for pull requests to include
the correct version.
@dirkh: Unfortunately this is potentially going to break builds when it is
merged, as there is no good way to 'test' a merge build short of
merging.
We'll just have to deal with the fallout of it in a follow-up pull
request.
Signed-off-by: Michael Keller <github@ike.ch>
46cf2fc086 fixed a bug where clearing of a divelog, such as the one
used for import, would erase dives in the global(!) divelog.
However, the new code used the function clear_dive_table(), which
only cleared the table without unregistering the dives. In particular,
the dives were not removed from the trips, which means that the trips
were not free()d.
This reinstates the old code, but now passes a divelog paremeter
to delete_single_dive() instead of accessing the global divelog.
Moreover, delete dives from the back to avoid unnecessary
copying.
An alternative and definitely simpler solution might be to just
add a "clear_trip_table()" after "clear_dive_table()".
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>