Commit graph

20093 commits

Author SHA1 Message Date
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
Michael Keller
d92777a3ff Packaging: Cleanup Windows Build Scripts.
Do some housekeeping and cleanup on the build scripts for Windows:
- remove Windows 32bit builds as support for this has been removed from
  the mxe container;
- fix some warnings in the smtk2ssrf installer configuration;
- sanitise the output colour of the smtk2ssrf build script;
- add a docker based build script for the Windows installers;
- remove outdated and deprecated documentation and scripts.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-04-26 07:42:59 -07:00
jme
e09a134a3f Delete desktop-widgets/preferences/preferences_dc.ui
Remove preferences "Dive Download" window.    Delete all dive computers no longer needed now that they can be deleted on the import window.

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
2024-04-26 08:14:16 +12:00
jme
aecb4f5005 Delete desktop-widgets/preferences/preferences_dc.h
Remove preferences "Dive Download" window.    Delete all dive computers no longer needed now that they can be deleted on the import window.

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
2024-04-26 08:14:16 +12:00
jme
358b9186bf Delete desktop-widgets/preferences/preferences_dc.cpp
Remove preferences "Dive Download" window.    Delete all dive computers no longer needed now that they can be deleted on the import window.

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
2024-04-26 08:14:16 +12:00
jme
12ae3d4e96 Update preferencesdialog.cpp
Remove preferences "Dive Download" window.    Delete all dive computers no longer needed now that they can be dleted on the import window.

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
2024-04-26 08:14:16 +12:00
jme
34926f1325 Update CMakeLists.txt
Remove preferences "Dive Download" window.    Delete all dive computers no longer needed now that they can be dleted on the import window.

Signed-off-by: jme <32236882+notrege@users.noreply.github.com>
2024-04-26 08:14:16 +12:00
Michael Keller
da8509d29b Cleanup: Actualise README.md
Actualise the status badges in README.md, and remove the outdated
reference to the current release.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-04-26 01:14:23 +12:00
Michael Keller
9deef235e2 Cleanup: Fix new Findings in Coverity Scan.
Fix some findings in a Coverity scan in `core/planner.cpp` and
`core/profile.cpp`, that were reported as new after the changes
in #4126 (likely because of the rename from .c to .cpp).
Results: https://scan4.scan.coverity.com/#/project-view/60459/13160

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-04-24 10:15:53 +02:00
Berthold Stoeger
e7a6de3894 core: use std::string instead of strndup()
Allows us to remove the strndup.h header. This code will be
even more simple, once core is fully converted away from C-strings.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
177a1a6706 make format-warnings hard compile errors
Code such as `report_info("msg: %s", i)` may crash if `i` is
not a string type. To avoid such problems make format-warnings
hard compile errors.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
556ecd5a9b core: use C++-primitives for g_tag_list
The old code was leaking memory. Use std::unique_ptr<> for
ownership management.

This is still very primitive and divetags are kept during
application lifetime. There should probably be some form
of reference counting. And the taglist should not be global,
but attached to the divelog.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
b320942343 Replace remaining qDebug()s by report_info()
The only case left is in android.cpp, though that is only compiled
when compiling the full desktop app on Android. I.e. never. So
don't bother for now.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
8867edffe8 Replace qDebug() by report_info() in profilewidget2.cpp
Remove those that are commented out, since this part of the code
will not be ported to QtQuick. So why bother?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
991b72d4ff Replace qDebug() by report_info() in core/cloudstorage.cpp
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
47254d91e0 Replace qDebug() by report_info() in qt-init.cpp
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
9923d49624 Replace qDebug() by report_info in qthelper.cpp
To do so replace QStrings by std::strings in ui-language code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
9febfdd084 Remove diabled debugging output in subsurfacewebservices.cpp
Why bother with commented out code?

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
8677d1f325 Replace qDebug() by report_info() in downloadfromdcthread.cpp
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
6dd5ec296d Convert qDebug() to report_info() in testing code
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
4de109bbf1 Replace qDebug() by report_info() in bluetooth code
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
d83da05f8d Replace qDebug() by report_info in checkcloudconnection.cpp
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
b6439e0420 Replace qDebug() by report_info() in smtk-import
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
ab7218d543 Use report_info() instead of qDebug in mobile code
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
2c2ad1e5c9 user report_info() instead of qDebug in main() functions
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
4af2ec88bd Use std::vector<string> instead of QStringList in main()
In an effort to convert core to C++ structures.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
c6cd10a43f core: make getCloudURL() return an std::string
Let's use std::string in the core. Notably, I'd like to make
the numerous main() functions mostly independent of Qt. Some
things will have to remain, such as argument parsing, of course.

This changes the API: instead of returning an error code and
taking a pointer to the actual return-value, return an
std::optional<std::string>> that is set if the function succeeds.

Returning an empty string in the error case might be simpler,
but oh well...

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
8e106b0449 core: replace qDebug() by report_info() in subsurface-helper.cpp
Start unifying debug output.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
da7ea17b66 cleanup: replace fprintf to stderr by report_info()
Let's try to unify debugging output!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
b097c0a44f core: port errorhelper.c to C++
Use the C++-version of membuffer.

This fixes two memory leaks: report_info() on every(!) invocation
and report_error() before the error callback is set.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
ec0bc2d06c cleanup: replace MIN and MAX macrors by standard versions
In C++ files, replace MIN and MAX by std::min and std::max,
respectively. There are still a few C files using these
macros. Convert them in due course.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
b89029353f import: use C++ primitives in smartrak.cpp
Makes memory management more palatable.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
14cfb17c1a import: compile smartrak.cpp as C++
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
157b52aa6e tests: make git-storage test more robust
The code was crashing if it couldn't reach the cloud, because then
info.repo is NULL. Skip the test if that happens.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00
Berthold Stoeger
322c3b55e6 core: add compile time format check to format_string_std
Had to rewrite the thing, because gcc's warnings don't work
with templatized var-args. Since there is no string-format.cpp
and I didn't want to inline it, moved it to format.cpp.

String formatting is distributed around at least four
headers: membuffer.h, subsurface-string.h, format.h
and format-string.h. This really should be unified!

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-04-23 07:47:11 +07:00