Commit graph

20368 commits

Author SHA1 Message Date
rmultan
29138b98ae Fix build for android
Patch libgit2 build

Signed-off-by: rmultan <multan.rafal.k@gmail.com>
2024-07-29 23:48:20 +12:00
rmultan
ae734603b9 Fix MacOS build & update INSTALL.md
Fix build for Apple silicon Mac.
Update INSTALL.md with relevant
instructions.

Signed-off-by: rmultan <multan.rafal.k@gmail.com>
2024-07-29 23:48:20 +12:00
Michael Keller
6d43b8e334 From libdivecomputer: Add support for Mares Sirius.
Signed-off-by: Michael Keller <github@ike.ch>
2024-07-25 21:57:33 +12:00
Michael Keller
fc0a569cb6 CICD: Add Parameters to Android docker Build Script.
Add parameters to the docker build script for Android, to make it
possible to inject custom configuration when calling it from other
scripts.

Signed-off-by: Michael Keller <github@ike.ch>
2024-07-21 14:25:50 +12:00
Michael Keller
35556b9f43 Move to available MacOS runner version.
Signed-off-by: Michael Keller <github@ike.ch>
2024-07-15 11:56:01 +12:00
Michael Keller
d278461bcc Temporarily pull and use an undefined version of the AppImage tool.
Signed-off-by: Michael Keller <github@ike.ch>
2024-07-15 11:56:01 +12:00
Michael Keller
39ca2a1026 CICD: Update AppImage Workflow to Be Based on ubuntu 20.04 Image.
Update the AppImage workflow to be based on ubuntu 20.04 in order to
support the updated requirement of GitHub actions to run on node 20.

Signed-off-by: Michael Keller <github@ike.ch>
2024-07-15 11:56:01 +12:00
Michael Keller
b3ff706c5f Filtering: Usability Improvements to Filter Constraints.
Some improvements:
- for constraints where the condition is applied to any one of a list of
  items, show the condition as 'any X';
- when filtering for tags, do not include divemode as a 'tag' - this is
  hard to impossible for users to understand, and we do have a dedicated
  condition for the dive mode.

Signed-off-by: Michael Keller <github@ike.ch>
2024-07-07 12:20:31 +12:00
stevebuie
269e834546 Fix crash on mac os during download from new BLE computer
Added entry to change log for the fix.

Reported-by: Steve Buie <sbuie321@gmail.com>
Signed-off-by: Steve Buie <sbuie321@gmail.com>
2024-06-28 14:51:07 +12:00
stevebuie
8f4f8fe489 Fix crash on mac os during download from new BLE computer
Ensure that any bluetooth scan started (by changing the device name) in the
download-from-dive-computer dialog (desktop version) is stopped before the
download process is started up. Because the QT bluetooth discovery agent uses
a QTimer internally, it must be stopped from the same thread as it was started
from. The download process uses a different thread, so ends up crashing when
it tries to dispose of the timer from a different thread.

Reported-by: Steve Buie <sbuie321@gmail.com>
Signed-off-by: Steve Buie <sbuie321@gmail.com>
2024-06-28 14:51:07 +12:00
Berthold Stoeger
1b4111c1f8 tests: fix commit "work on sorted dive lists"
Commit 185b4678ff changed the parser-test to use sorted dive
lists. However, for the "new Seabear" data format test, the
sorting was done after comparison. Which is obviously silly.

Fix it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-21 16:51:32 +02:00
Berthold Stoeger
3257dbfc63 cleanup: remove unused function get_dive_id_closest_to()
The last caller was removed in e700920e8e.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-19 06:55:36 +02:00
Berthold Stoeger
185b4678ff tests: work on sorted dive lists
The dive list will be changed to an always-sorted list where one can
use binary search.

However, this makes some tests fail, because they only use parse_dive(),
which doesn't do any sorting.

To fix this future problem, sort the tables before performing the tests.
This provides a more realistic setup, as in the actual application,
the dive list will always be sorted on import.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-17 00:03:28 +02:00
Berthold Stoeger
0940ff23b9 tests: run profile test using default preferences
As noted in a comment introduced in fe074ccad1, the profile test
should probably best be run using the default preferences. This
wasn't done back then, because the reference data assumes a (bogus)
setting of modO2 of 0.

This commit runs the test using the default preferences and updates
the reference data accordingly.

This is in preparation of changes to the preference system, where
the preference structure initializes itself to the default values.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-06-16 19:44:29 +02:00
Michael Keller
31fca0f676 Filter: Fix Loading of Negated Conditions from git.
Fix loading of the negation of filter conditions. Unlike other
conditions that are persisted as `<key>="<value>"`, this is persisted
to git as `negate`.
This fix remediates this for all cases where the condition has already
been saved to the cloud storage.

Saving to XML takes a different approach and indicates negated
conditions with `negate="1"`, making it identical to all other
attributes. The question is if this approach should be implemented in
addition to the above fix, in order to unify the storage format.

Fixes #4246.

Signed-off-by: Michael Keller <github@ike.ch>
2024-06-15 22:49:44 +02:00
Michael Keller
b126fccb1b Desktop: Fix Inconsistencies in Handling of Salinity.
- add correct setting of the water type drop down for the dive shown
  initially after program start;
- change salinity to have 3 decimals in planner, to make it consistency
  with the log.

Fixes #4240.

Reported-by: @ccsieh
Signed-off-by: Michael Keller <github@ike.ch>
2024-06-10 15:54:22 +12:00
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