Commit graph

20077 commits

Author SHA1 Message Date
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
Michael Keller
447f9709f7 CICD: Fixup Merge Build Workflows on master.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-13 10:46:33 +12:00
=Michael Keller
4ae6c0bbc4 CICD: Add Workflow to Pin the Generated Artifacts.
Signed-off-by: Michael Keller <github@ike.ch>
2024-05-13 10:19:59 +12:00
=Michael Keller
6fc8310705 CICD: Improve Workflows.
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>
2024-05-13 10:19:59 +12:00
Berthold Stoeger
e20ec9248c core: fix leak when clearing dive log
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>
2024-05-13 08:58:03 +12:00
Berthold Stoeger
8769b1232e planner: initialize currCombo.ignoreSelection
I am not sure what this does, but it should be initialized before
it is tested.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-05-12 13:23:21 +02:00
Berthold Stoeger
d061a54e3d planner: fix gas selection
The lambda that created the list of gases took a copy not a
reference of the planned dive. Of course, that never had its
gases updated. Ultimately this would crash, because this sent
an index of "-1" on change.

Fix by
1) Using a reference to the dive, not the copy
2) Catch an invalid "-1" index (by Michael Keller <github@ike.ch>)

Fixes #4188

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-05-12 13:23:21 +02:00
=Michael Keller
306dad575c CICD: Update the AppImage Build to Use ubuntu 16.04.
Update the linux AppImage build to use ubuntu 16.04, and simplify it to
a single workflow running on a vanilla docker image.

This still uses the upload-artifact@v3 Action that will be EOL in
November 2024, because v4 relies on node 20 which has an unmet glibc
dependency in ubuntu 16.04. But this workflow can be updated to run on
ubuntu 18.04 by a simple search / replace and disabling some 16.04
specific PPAs.

@dirkh, @probonopd: I have moved this here from #4183 to be able to
review and discuss it without the noise of the workflow cleanup.

The workflow now also publishes the AppImage as an artifact on pull
request builds, available under Checks / Details / Summary.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-12 13:52:12 +12:00
Michael Keller
331d6712c6 CICD: Move MacOS / iOS Build Qt Resources into GitHub.
Move the Qt resources required for the build for MacOS and iOS into
GitHub, into their own repositories. This removes the need to publish
them on an external file server and download them from there for every
build.
It will also make it easier for contributors to update these resources
if needed.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-12 10:19:24 +12:00
Michael Keller
f4e61aa5dc Import: Make Directory Selectable when Importing .fit Files.
In the 'Download from dive computer' dialogue, make it possible to
select the source directory for the import.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-11 12:52:05 +12:00
Michael Keller
528532572f Planner: Fix Editing of Plans in Multi-Divecomputer Dives.
Currently editing of planned dives that have been merged with actual
(logged) dives only works if the 'Planned dive' divecomputer is the
first divecomputer, and this divecomputer is selected when clicking
'Edit planned dive'. In other cases the profile of the first
divecomputer is overlaid with the profile of the planned dive, and the
first divecomputer's profile is overwritten when saving the dive plan.
Fix this problem.

Triggered by @SeppoTakalo's comment (https://github.com/subsurface/subsurface/issues/1913#issuecomment-2075562119): Users don't like that planned dives show up as their own entries in the dive list, so being able to merge them with the actual dive after it has been executed is a good feature - but this wasn't working well until now.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-11 12:51:45 +12:00
=Michael Keller
a83349015a CICD: Improve the GitHub Actions for Linux.
Do a few things:
- add a build for Debian trixie (as discussed in #4182);
- add a build for Ubuntu 24.04;
- rename the build definitions to match the build names;
- update the artifact uploads to use a non-deprecated version of the
  action, and name the artifact appropriately;
- remove a stale workflow file.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-11 12:51:33 +12:00
=Michael Keller
8627f6fc4a Desktop: Add Auto-sizing to the Extra Info Table.
Add auto-sizing to the extra info table - resize the columns so that all
rows are shown in full whenever the data is updated.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-08 08:26:56 -07:00
Michael Keller
5bad522390 Update livdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-08 12:34:31 +12:00
Richard Fuchs
edb771e8e6 uemis-downloader: convert strings to std::string
Convert some C-style strings in uemis-downloader.cpp to std::string.
This has the side effect of fixing builds on Debian Trixie, which
currently fail with the (rather silly) error:

/build/subsurface-beta-202405060411/core/uemis-downloader.cpp: In function 'char* build_ans_path(const char*, int)':
/build/subsurface-beta-202405060411/core/uemis-downloader.cpp:290:32: error: '%s' directive output between 0 and 12 bytes may cause result to exceed 'INT_MAX' [-Werror=format-truncation=]
  290 |         snprintf(buf, len, "%s/%s", path, name);
      |                                ^~
......
  529 |         ans_path = build_filename(intermediate, fl);
      |                                                 ~~
cc1plus: some warnings being treated as errors

Signed-off-by: Richard Fuchs <dfx@dfx.at>
2024-05-07 22:34:00 +12:00
=Michael Keller
17d83acdab Documentation: Add Instructions for Using Qt 5.15.13 on MacOS.
Add instructions for using Qt 5.15.13 on MacOS, which seems to have
better support for Apple silicon.`

Provided-by: jme <32236882+notrege@users.noreply.github.com>
Signed-off-by: Michael Keller <github@ike.ch>
2024-05-07 18:43:26 +12:00
=Michael Keller
133354d51d CICD: Update Qt Version Used in the MacOS Build to 5.15.13.
Update the version of Qt that is used in the CICD build for MacOS to
5.15.13. This version is showing promise for building binaries that work
on Apple silicon.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-07 18:43:26 +12:00
Michael Keller
46cf2fc086 Import: Fix Application Hang when Cancelling the Download Dialogue.
Fix a bug causing the 'Download from dive computer' dialogue to hang
when the user attempts to cancel the dialogue after successfully
downloading one or more dives.

Fixes #4176.

Signed-off-by: Michael Keller <github@ike.ch>
2024-05-05 19:15:26 +02:00
Michael Keller
5ac1922d84 Cleanup: Improve (Android) Build Scripts.
Add a script for building the Android APK in the docker container.
Also make some improvements to the Windows build scripts, and update the
documentation for both builds.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-05-06 00:45:51 +12:00
Michael Keller
3153a139b3 Update livdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2024-05-04 01:41:51 +12:00
Michael Keller
e65c7cedc8 Refactoring: Improve Naming of FRACTION and SIGNED_FRAC defines.
Make it more obvious that the FRACTION and SIGNED_FRAC defines return a
tuple / triplet of values.

Fixes https://github.com/subsurface/subsurface/pull/4171#discussion_r1585941133

Complained-about-by: @bstoeger
Signed-off-by: Michael Keller <github@ike.ch>
2024-05-02 20:36:26 +02:00
Berthold Stoeger
32a08735c3 profile: fix string formating in profile.cpp
ae299d5e66 introduced a format-
string bug by splitting a format-string in two and splitting
the arguments at the wrong place.

The compiler doesn't warn in this case, because the format-
string is passed through translate(...).

This should have crashed, but for some reason didn't, at least
on Linux.

Fix the arguments.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-05-01 20:39:59 +12:00
Michael Keller
af6caa6fa2 Import: Improve Error Logging.
Add logging of the libdivecomputer return code for errors. Also, switch
logging of errors in the background thread to callback based logging to
make it visible.

Signed-off-by: Michael Keller <github@ike.ch>
2024-04-30 12:26:18 +12:00
Michael Keller
f3c7dcf9c9 Desktop: Fix 'planned' and 'logged' Filters.
Fix the filters for planned (i.e. has at least one dive plan attached)
and logged (i.e. has at least one dive computer log attached) dives.
Also refactor the respective functions for improved readability.

Signed-off-by: Michael Keller <github@ike.ch>
2024-04-30 12:25:31 +12:00
Michael Keller
bb00a9728f Cleanup: More Fixes for Problems Reported by Coverity.
Fix the problem another way as Coverity was still not happy with it.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-04-28 23:44:16 +12:00
Michael Keller
a2cd621819 Update livdivecomputer to latest on 'Subsurface-DS9'.
Signed-off-by: Michael Keller <github@ike.ch>
2024-04-28 18:52:19 +12:00