Commit graph

19726 commits

Author SHA1 Message Date
Berthold Stoeger
429230ced1 saving: fix resource leak found by coverity
fp_get_data() returns a copy of a string that must be freed.
Fix this in save-git.c. The analogous function in save-xml.c
has already been fixed. However, change the code to be more
idiomatic: since we own the pointer, make it "char *" instead
of "const char *". Then we don't have to cast on free().

Ultimately, we really should change string manipulation code
to C++.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-17 14:23:19 -08:00
Berthold Stoeger
91e4fb4769 cleanup: more Coverity silencing
Mostly irrelevant std::move() stuff of copy-on-write Qt objects,
a few real bugs, a timestamp_t downconversion and some codingsyle
adaptation.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-17 14:23:19 -08:00
Berthold Stoeger
35ff6eea35 desktop: block signals when setting combobox-indexes
On the InformationTab a signal is emitted when programatically
setting the index of the dive mode combobox which in turn then
edits the dive.

Usually not a problem, because the editing code realizes that
the value is not changed. It is however a problem when multiple
dives are selected.

Therefore, block the signals when setting the index. Same for
the other comboboxes on the same page.

Fixes #3960.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-16 14:52:36 -08:00
Berthold Stoeger
bdade9e499 planner: initialize subobject of PlannerWidgets in correct order
The DivePlannerWidget was initialized before the planner models.
However, it attaches these (non existing) models to the comboboxes.
That can't work. Initialize in correct order.

Fixes #4014

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-16 14:22:16 -08:00
Berthold Stoeger
13b894a756 gases: fill result of isobaric_counterdiffusion() on early return
If prefs.show_icd is false, this function does nothing, but
the output parameter is checked by the calling function
DiveEventItem::setupToolTipString().

Let's reset the strucvture to 0.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-16 14:22:16 -08:00
Michael Keller
4bab38b8df CICD: Make it Possible to Run CICD Builds in a Fork.
Use the project name to resolve the target repository to create the release in.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-01-15 19:53:54 -08:00
Dirk Hohndel
2db8b51eed build-system: missed one release note mention without .md
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-15 17:42:03 -08:00
Michael Keller
6c8afabedf CICD: Improve the Release Note Generation
Use .md suffix to get the files displayed as markdown.
Ignore generated artefacts.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-01-15 17:32:57 -08:00
Berthold Stoeger
249b82f6dc pictures: make delta-time a 64-bit int
When adjusting picture times, the offset in seconds is stored in a
32-bit int. Make it a 64-bit int. Sounds crazy, because why would
you want to move the pictures by more than 70 years?

Well, suppose it is the year 2039, for some strange reason your
camera was set to unix epoch and you want to adjust the pictures
to current time.

Ok - that's a far-fetched scenario. The real reason is that this
hopefully silences a Coverity warning and avoids integer casting.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-15 15:11:36 -08:00
Berthold Stoeger
8a3a0edb83 cleanup: silence std::move()-related Coverity warnings
Unfortunately Coverity doesn't understand that most Qt data
structures are copy-on-write. It's a mis-feature of Qt, but
it is the way it is. Thus, passing by value is not an issue.

Out of ca. 25 warnings only two were legit. Let's silence
the others by either std::move()ing or passing by reference,
as would be idiomatic C++, which Qt is not.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-15 15:11:36 -08:00
Alexander Wilms
ac0d44bccf Update AppStream metainfo
Add more information to metainfo file and update it to the AppStream 1.0
standard

* Added screenshot caption, more URLs and a <launchable/> tag
* Replaced <developer_name/> with <developer/>

Now the file conforms to the AppStream 1.0 specification

Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2024-01-14 15:59:29 -08:00
Alexander Wilms
c92ebd1f3b Change AppStream metainfo file extension and path
The legacy /usr/share/appdata/*.appdata.xml path has been superseded by
/usr/share/metainfo/*.metainfo.xml

https://freedesktop.org/software/appstream/docs/chap-Metadata.html#spec-component-location

Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2024-01-14 15:59:29 -08:00
Berthold Stoeger
798e426926 cleanup: fix enum in profile.c
There are two enums related to the type of dive.
There is the global

enum divemode_t {OC, CCR, PSCR, FREEDIVE, NUM_DIVEMODE,
                 UNDEF_COMP_TYPE};

and the anonymous

enum {AIR, NITROX, TRIMIX, FREEDIVING} dive_type;

in struct plot_info.

In profile.c FREEDIVE (of divemode_t) is assigned to dive_type.
This only works because by chance(?) FREEDIVE and FREEDIVING are
the fourth element of each enum.

Fix this. C truly is a bad language when it comes to types
(very weak) and namespaces (non existing).

Contains whitespace fix.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-01-13 09:14:32 -08:00
Dirk Hohndel
1b7daeee22 CICD: improve release notice
This should make it clearer what the various files are. I wish we could sort by
file extension.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-12 14:17:39 -08:00
transifex-integration[bot]
4aafc304a1 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
fb567fe00b Removing subsurface_source.ts in de_DE
99% of minimum 100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
8173ebaf36 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
6d120cde59 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
bbd810367a Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
55c751e219 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
f4186dc076 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
e81a2b480f Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
21b5a58eda Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
ff82441946 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
2450080725 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
bdf40f02f3 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
8c60657ec8 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
d6d65fa673 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
c6f3a5bd47 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
transifex-integration[bot]
ef47d03478 Translate subsurface_source.ts in de_DE
100% translated source file: 'subsurface_source.ts'
on 'de_DE'.
2024-01-12 13:14:29 -08:00
Salvador Cuñat
5bae033f07 [scripts - docker] Fix build instructions
Current instruction to get the installer out the container will fail
with bash complaining about cp being a binary. Then would fail too
because subsurface-installer.exe doesn't exist any more.

Proposed instruction should work.

Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2024-01-10 21:10:31 -08:00
Dirk Hohndel
7d918aeef1 CICD: gracefully handle non merge pushes
Also improve the spacing of the merge text a tiny bit.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 19:24:36 -08:00
Dirk Hohndel
9bf79c460a CICD: don't increment build number for pull requests
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 19:24:01 -08:00
Dirk Hohndel
eb4f3121bc CICD: clean up the noisy scripts
This all is way too verbose now that it apparently is working.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 19:14:25 -08:00
Dirk Hohndel
2f464c114d CICD: attempt to read file content in GH yaml
It is very strange that in some yaml files the $(<release-version) construct
works just fine, but in others it evaluates to an empty string, even though the
file is there an has the correct content.

Attempting to get more debugging info and also use a different expression to
extract the information.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 17:13:53 -08:00
Dirk Hohndel
8fb504941e the path confusion is vert annoying
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 16:58:08 -08:00
Dirk Hohndel
c2acdafcdf build-system: fix the APK filename for release upload
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 16:58:08 -08:00
Michael Keller
506a96f1f6 CICD: Fix GitHub Actions.
Fix the setting of environment variables in the android build.
Also fix a typo in the AppImage build.

Signed-off-by: Michael Keller <mikeller@042.ch>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
53f6d1d606 build-system: remove pointless assignment
Suggested-by: Michael Keller <github@ike.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
5b2d1a4506 build-system: get the buildnr file from the right directory
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
ca5f7fa4bf build-system: correctly test that branch was created
That '-b' was exactly the wrong thing to do here...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
744257149f build-system: push to origin instead of explicit URL
Otherwise we don't use the embedded credentials and the push fails.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
9aa9bec914 build-system: use GitHub Actions outputs
Tempting as it is to think this is just like bash - yaml isn't bash at all.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
c0c447a5b6 build-system: don't discard the get-or-create-build-nr script output
That was the whole point of the previous change.
Also, run the build number creation on a pull request as well (at least for a
while) so we don't need to create new releases in order to test that part of
the process).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 13:44:06 -08:00
Dirk Hohndel
30efede730 build-system: small changes for better debugging
In order to make it easier to see what's happening inside get-atomic-buildnr.sh
write the result to a file that can be read by the caller. Not quite as
elegant, but hopefully more practical to see what's going wrong when no new
build number is created.

Make sure that post-releasenotes is successfull by actually posting a release
artifact (apparently the gh release action otherwise quietly fails).

Try to ensure we find the Android APK when uploading to the release.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 11:54:44 -08:00
Dirk Hohndel
c33e05c1d4 build-system: create release notes only once
Some experimentation showed what should have been obvious. The release
information is additive. So it's enough if ONE of the actions creates release
notes, all the others can simply add additional release artifacts.

To make this more obvious, this commit creates a new action that does nothing
but create the release notes and publish the release. Since it really doesn't
do anything else, it's likely to be the quickest to complete, but that doesn't
matter - the last action that has a body or body_path in the gh-release action
determines the release notes. And we now have exactly one action that does so.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-10 09:17:49 -08:00
Dirk Hohndel
14e715be6e build-system: assemble release notes using gh CLI
Instead of using a thirdparty action and painfully passing things around,
simply use the GitHub CLI (gh) and assemble the release notes on the fly.

This makes for much simpler and much easier to maintain code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-09 17:14:42 -08:00
Michael Keller
867d31bcbc Another Fix for the android Action.
Signed-off-by: Michael Keller <github@ike.ch>
2024-01-10 07:25:23 +13:00
Michael Keller
deab622c3e CICD: Fix the android Action.
Fix the android action.

Signed-off-by: Michael Keller <github@ike.ch>
2024-01-10 07:17:05 +13:00
Dirk Hohndel
13603a0878 build-system: avoid output that confuses the script
The get-or-create-buildnr.sh script writes a nice message to stdout which is useful
when using it interactively - but it broke the scripting; so redirect that output.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2024-01-08 21:38:38 -08:00