Commit graph

20202 commits

Author SHA1 Message Date
Michael Keller
10fc3bfd47 Bugfix: Fix Incorrect Volumes Displayed for Tank Types.
Fix an issue introduced in #4148.
Essentially the refactoring missed the fact that in the imperial system
tank size is tracked as the free gas volume, but in the metric system
(which is the one used in most of Subsurface's calculations) tank size
is tracked as water capacity.
So when updating a tank template tracking imperial measurements, the
given (metric) volume in l has to be multiplied by the working pressure,
and vice versa.
This also combines all the logic dealing with `tank_info` data in one
place, hopefully making it less likely that this will be broken by
inconsistencies in the future.

Fixes #4239.

Signed-off-by: Michael Keller <github@ike.ch>
2024-06-09 11:15:59 +02:00
Berthold Stoeger
a8c9781205 cleanup: remove unused function create_and_hookup_trip_from_dive()
It seems that the last user was removed 5 years ago: ff9506b21?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-08 15:59:53 +02:00
Michael Keller
291ed9d7e3 Documentation: Update Information on Available Versions in README.md.
Update the information on the available versions of Subsurface in
README.

Also update the documentation to reflect the renaming of `INSTALL` to
`INSTALL.md`.

Signed-off-by: Michael Keller <github@ike.ch>
2024-06-06 16:17:44 +12:00
Michael Keller
a39f0e2891 Mobile: Fix QML Warnings.
Fix some runtime warnings when running the mobile build caused by
binding loops and deprecated handler syntax.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-06-06 16:17:32 +12:00
Dirk Hohndel
d9f50bb8e0 add Ubuntu 24.04 / Noble Numbat to our builds
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-06-05 13:23:52 -07:00
Michael Keller
d1db85005b CICD: Remove Workaround for Broken ubuntu 16.04 Repository.
ATTENTION: Only merge this when CICD starts working (will need a rebase
to trigger a build).

Signed-off-by: Michael Keller <github@ike.ch>
2024-06-05 10:52:34 +12:00
Berthold Stoeger
e2d3a12555 cleanup: remove unused roles in DiveTripModelBase
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>
2024-06-05 09:16:32 +12:00
Michał Sawicz
568aeb7bce snap: drop candidate channel
Building directly into `stable` from the `current` branch.

Signed-off-by: Michał Sawicz <michal@sawicz.net>
2024-06-03 07:59:22 -07:00
Berthold Stoeger
ca5f28206b tests: make profile test work with non-C locales
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>
2024-06-03 07:41:47 +02:00
Michael Keller
adaa52bf9b Desktop: Fix Undo for Gaschanges on Manually Added Dives.
Fix the undo functionality for gaschanges edited on manually added
dives.

Pointed-out-by: @bstoeger
Signed-off-by: Michael Keller <github@ike.ch>
2024-06-02 11:38:21 +02:00
Michael Keller
692ec9ee5c Update libdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2024-06-02 16:33:19 +12:00
Michael Keller
c2c5faeaad Add the change for MacOS builds with Qt6 as well.
Signed-off-by: Michael Keller <github@ike.ch>
2024-06-02 09:42:14 +12:00
jme
88acef7f0f release build google maps
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>
2024-06-02 09:42:14 +12:00
Michael Keller
32cd52869b CICD: Fix the AppImage Workflow.
Work around an upstream version inconsistency by pinning the versions in
our build.

Signed-off-by: Michael Keller <github@ike.ch>
2024-06-02 01:35:29 +12:00
Berthold Stoeger
3d96642b8d smartrak: remove copy_string() that makes little sense
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-01 14:43:33 +02:00
Michael Keller
c5546fb52f Cleanup: Optimise String Handling.
Cleanup of the sub-optimal string handling in #4222.

Signed-off-by: Michael Keller <github@ike.ch>
2024-06-01 14:43:03 +02:00
Michael Keller
f65afaf5d2 Desktop: Fix Gas Editing for Manually Added Dives.
- 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>
2024-06-01 23:22:40 +12:00
Berthold Stoeger
9243921cbb test: fix subtle bug in testplan.cpp
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>
2024-05-31 22:50:49 +02:00
Michael Keller
d27451979d Profile: Add Gas Description to Disambiguate.
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>
2024-05-31 22:50:09 +02:00
Berthold Stoeger
e7d486982f core: remove put_format_loc()
This was replaced by C++ functions in ae299d5e66.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-05-31 18:55:47 +02:00
Michael Keller
5b941ea34e Mobile: Fix Build Warnings.
Fix build warnings from building functions not used in the mobile
version.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-30 11:54:51 +02:00
Michael Keller
56f1e7027f Documentation: Update INSTALL and Convert it to Markdown.
Update the instructions for the Windows build and convert the file to
markdown.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-30 14:22:16 +12:00
Berthold Stoeger
64d4de4a1b fix memory leak
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>
2024-05-29 10:03:41 +12:00
Berthold Stoeger
e39b42df53 cleanup: remove disfunct add_cloned_weightsystem_at()
Clearly, a development artifact.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-05-29 09:33:23 +12:00
Berthold Stoeger
398cc2b639 cleanup: remove localized snprintf() functions
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>
2024-05-29 09:33:23 +12:00
Berthold Stoeger
2776a2fe48 import: fix memory leak when importing dives
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>
2024-05-27 20:11:37 +12:00
Michael Keller
1aa5438b2d Cleanup: Improve the Use of 'Planned dive' and 'Manually added dive'.
- 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>
2024-05-25 20:13:45 +02:00
=Michael Keller
ecc6f64d10 Cleanup: Improve Connection Handling in Profile.
- improve naming;
- remove unneeded disconnects.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-25 16:31:04 +02:00
=Michael Keller
8c14fb971c Update livdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2024-05-25 08:54:53 +12:00
Dirk Hohndel
6bdfee080d Merge remote-tracking branch 'origin/translations_translations-subsurface-source-ts--master_de_DE' 2024-05-21 08:04:37 -07:00
Dirk Hohndel
21269183bf Merge remote-tracking branch 'origin/translations_translations-subsurface-source-ts--master_pt_PT' 2024-05-21 08:04:17 -07:00
=Michael Keller
245f8002a8 CICD: Remove Workflow to Build ubuntu 14.04 Docker Image.
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>
2024-05-20 09:56:01 +12:00
=Michael Keller
c3d807802d Desktop: Fix Finding Reported by Coverity.
Signed-off-by: Michael Keller <github@ike.ch>
2024-05-18 14:07:15 +02:00
Michael Keller
a66bdb1bf5 Planner: Improve Exit Warning.
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>
2024-05-17 16:44:04 +12:00
Michael Keller
b579342639 Cleanup: Remove 'context' Reference from Logging Defines.
Remove the reference to `context` from the defines used for logging, as
this is not used.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-16 16:39:48 +02:00
Michael Keller
888704e816 CICD: Have the Artifact Comment Workflow Suppress 'No Artifacts' Errors.
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>
2024-05-15 13:29:25 +12:00
Berthold Stoeger
6880937838 core: fix INFO() and ERROR() macros in core/serial_ftdi.cpp
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>
2024-05-15 09:19:05 +12:00
Michael Keller
d018b72dab CICD: Fix Signing of Android CICD Built Packages.
Fix the signing of Android .apk packages when they are build in CICD.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-14 15:21:05 +12:00
Michael Keller
b3d6920de4 CICD: Remove Environment Dumping in Artifact Comment Workflow.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-14 13:36:26 +12:00
Michael Keller
912badadd4 CICD: Restrict Artifact Comment Workflow to only Run on Pull Requests.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-14 13:35:12 +12:00
Michael Keller
1c0fe2fa1f Fix GitHub Workflow definition.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-14 12:53:10 +12:00
Michael Keller
48ef4b3a01 CICD: Debug GitHub Workflow Webhook
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-14 12:06:51 +12:00
Michael Keller
22082bd60a CICD: Fix Coverity Scan Workflow.
Change the ordering of steps so that git is installed before the
checkout is performed.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-14 10:57:04 +12:00
Michael Keller
be1b80ea8a CICD: Fix the AppImage Workflow.
Fix the workflow by removing the dependency on node 20, which is not
supported in Ubuntu 16.04.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 14:54:49 +12:00
Michael Keller
e81b42d533 Add environment variable required to be able to use the GitHub CLI.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 12:55:09 +12:00
Michael Keller
dd50ab0106 Fix incorrect script references.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 12:39:09 +12:00
Michael Keller
0d6b572a9f Fix script permissions.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 12:32:07 +12:00
Michael Keller
21f64134b7 Fix custom action YML.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 12:17:13 +12:00
Michael Keller
7bf40d659c Fix custom action.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 12:13:41 +12:00
Michael Keller
6ae2844f24 CICD: Fixup Merge Build Workflows on master.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 11:07:05 +12:00