Commit graph

19600 commits

Author SHA1 Message Date
Dirk Hohndel
15f3918171 build-system: small fixes for Fedora copr build
The extra trailing 'dot' broke the cmake build on Rawhide.
This also tries to give more consistent Summary and Description text for
the Subsurface and Subsurface-test repos on copr.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-05-17 10:25:30 -07:00
Dirk Hohndel
c2f0a6f3e1 update libdivecomputer
Garmin: Handle file names in short format

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-05-14 11:09:40 -07:00
Dirk Hohndel
c1e7cd1428 build-system: consistently mark git directories safe
Even on platforms that don't have the new git version, yet.
And using the convoluted way to create an environment variable that should
point to our checked out tree in the GitHub Action. The more obvious ways
have resulted in failed builds for obscure reasons.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-05-14 10:28:56 -07:00
Dirk Hohndel
8ead205c8c build-system: initial spec file for Fedora copr build
This should allow us to automate builds using the Fedora infrastructure.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-05-12 11:10:02 -07:00
Dirk Hohndel
df5c715afa build-system: work around git change in Fedora 35 build
Not sure why I didn't include that earlier.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-05-12 11:09:12 -07:00
Jim Wobser
89c6015cde Handle Mulitple Seac Computers colliding during import
The Seac importer was getting samples based only on dive number,
which was causing samples from different computers but with the
same dive number to become interleaved.

To correct this, the SQL statement was updated to use the
dive_id to query for samples. The table schema uses dive_id
as a primary key, which will enforce uniqueness.

Additionally, deviceid is hashed from the the device_id string.

Reported-by: David Brebera <david.brebera@gmail.com>
Signed-off-by: Jim Wobser <james.wobser@gmail.com>
2022-05-12 11:07:03 -07:00
Michał Sawicz
ef0a6b7bee [gha] refresh linux-snap.patch
Signed-off-by: Michał Sawicz <michal@sawicz.net>
2022-05-07 14:49:17 -07:00
Michał Sawicz
c7242a37be [snap] refresh for core20 and add Wayland support
Signed-off-by: Michał Sawicz <michal@sawicz.net>
2022-05-07 14:49:17 -07:00
Robert C. Helling
34b61ad288 Use 10ft as deco step size in imperial units in profile
The calculation of the deco steps shown in the profile
infobox is somewhat independent of the planner. When
set to imperial units, the distance between deco stops
should be 10ft rather than 3m as 15m is only 49ft.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2022-05-06 14:17:29 -07:00
Linus Torvalds
bdeeba4a67 core: fix detection of used cylinders
The cylinder_with_sensor_sample() function only tests "do we have a mapping to
this cylinder for this sample". It also needs to test if there are any tank
pressure readings for that cylinder.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-28 12:30:10 -07:00
Dirk Hohndel
51590853eb build-system: macOS universal builds imply Qt6 builds
Qt5 doesn't support the m1.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
efdc525a22 cmake: try harder to find the cmake modules we install
While I clearly recall that in the past the couple of cmake modules
that were installed when building the dependencies were found, in my
latest tests on macOS 12 with the latest cmake this seems to fail.

This seems like a cheap quick way to ensure that things behave as
expected.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
f0d819a842 build-system: fix building fat binaries on x86_64
It does seem a bit odd, but the arch command actually doesn't
return a reasonable architecture on macOS. So let's use the
uname -m command to get the right answer that makes this script
work both on an m1 and an Intel Mac.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
e7ea951122 update INSTALL instructions for macOS
And tiny whitespace fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
a73fd0ed60 cleanup: compile fix for latest Xcode
I'm not sure why these headers are needed here and nowhere else...

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-27 22:03:37 -07:00
Dirk Hohndel
8d9730f74f core: avoid crash when merging dive with no cylinders
Arguably every dive should at least have one cylinder, but an imported
dive from divelogs.de might end up without one. Sadly, that breaks
assumptions that we make in the cylinder remapping.

To work around it, force at least on cylinder to be assumed in the merge
code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-24 08:00:36 -07:00
Dirk Hohndel
5a5188bc47 build-system: don't build against Qt6 by default
As some Linux distros start to ship both Qt5 and Qt6, it actually makes more
sense to build only against Qt6 when the user explicitly asks for it. Having it
preferred over Qt5 seems completely wrong in hind sight.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-23 12:35:54 -07:00
Dirk Hohndel
36c991a1b8 build-system: work around git change in coverity build
The git ownership issue strikes again.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-22 21:32:50 +02:00
Linus Torvalds
dee13bf410 git access: save to local repository before doing remote access
.. at least if the local repository exists and can be opened.

If the local repo cannot be directly opened, we will still try to sync
with the remote first, but this way the *common* git save situation is
that we save locally before we then try to sync with the remote.

That means that if we have network problems, the save will happen before
we possibly hang due to really really slow networking.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-22 08:28:17 -07:00
Linus Torvalds
e33680c336 git access: add proper cleanup function for git_info
We had various random "free parts of the git info" left-overs from when
we passed down the git repo data ad-hoc.  Get rid of it, and replace it
with just doing a 'cleanup_git_info()' that does the final cleanup of it
all.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-22 08:28:17 -07:00
Linus Torvalds
96337dbbcf git access: rename 'check_git_sha()' function
That function name was incomprehensible.  What did it check? And what
did the return value mean?

So let's rename it to something that actually describes what it does,
and reverse the meaning of the return value while at it.

So now it's called 'remote_repo_uptodate()', and it returns true if the
remote repository branch has the same value as our 'saved_git_id'.

It's still a bit obscure, but at least within the context of the only
user, the code now makes _more_ sense than it used to:

        if (remote_repo_uptodate(fileNamePrt.data(), &info)) {
                appendTextToLog("Cloud sync shows local cache was current");

but maybe we could come up with even better semantics and naming, and
make it even clearer.

Requested-by: Dirk Hohndel <dirk@hohndel.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-22 08:28:17 -07:00
Linus Torvalds
6f5783b203 git access: move git repo open from update_local_repo() to caller
We currently only have one single caller of update_local_repo(), and
instead of that caller checking whether the existing repo is a
directory, just make it open the git repository.

This avoids duplicate error handling and simplifies the code.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-22 08:28:17 -07:00
Dirk Hohndel
ac70282193 macOS: build googlemaps plugin as fat binary
I couldn't make this to work as a single pass build, so we again do a dual pass
and manually assemble the dylib. This is then copied to a sane spot which
required another attempt to copy it in the CMakeLists.txt - which I added
comments to in order to make sense of the weirdness.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:39 +02:00
Dirk Hohndel
c41e2489a4 Qt6: update the connect calls for QNetworkReply
Because of the old connect syntax used the incorrect signal names weren't
caught at compile time. To switch to the new syntax we had to make two
functions pure virtual in the WebServices class - let's hope I got that right.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:39 +02:00
Dirk Hohndel
e9b4d02d24 macOS: update package build script
The create-dmg script changed repo name - let's support either version.
On newer Macs the SDKs are elsewhere - let's look there, too.
Let's be far more flexible when finding SDK versions.
Let's not assume that we are linking against QtWebKit (we're not with Qt6).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
53e153e6d7 build-system: make CMakeLists.txt more consistent
We used two different ways to add to the end of a list. Let's stick with
the more idiomatic one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
256f58e723 build-system: remove obsolete warning
Apparently Qt 6.3.0 already fixes this problem, so... never mind.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
baf23fd681 macOS: use software backend by default with Qt6
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
7bd17a1784 macOS: add the ability to create fat binaries
This also does some cleanup for some of the variable names.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
a8f1fccd89 build-system: more Qt6 / QtLocation updates
This adds a flag to explicitly enable a build against maps, which is
only needed for Qt6 (as we always assume that Qt5 has maps installed).

It also includes a quick fix to fail gracefully if libmtp was already
patched.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
ea961edec8 Qt6: first steps towards map support
There is an initial build of the C++ classes that seems to work, but the QML
integration is still missing. Still, progress is being made.

Unfortunately with Qt6 we can't forward declare the MapLocationModel class (one
of the operators needs to be able to determine the size of the class), so we
need to include the header file.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
2241a28499 build-system: make map support its own thing
Making this simply depend on Qt5 or Qt6 was short-sighted as work on QtLocation
upstream continues. Instead break this out as its own option.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
890f21bd58 whitespace cleanup
Random, I know. But it bugged me.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-18 07:24:38 +02:00
Dirk Hohndel
65ef08f167 git: remove file global is_subsurface_cloud
Just like the rest of the git repo related information, this is already
included in the git_info struct.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-17 22:14:34 -07:00
Linus Torvalds
7e632173e0 Collect and convert git repo data to 'struct git_info'
We have this nasty habit of randomly passing down all the different
things that we use to look up the local and remote git repository, and
the information associated with it.

Start collecting the data into a 'struct git_info' instead, so that it
is easier to manage, and easier and more logical to just look up
different parts of the puzzle.

This is a fairly mechanical conversion, but has moved all the basic
information collection to the 'is_git_repository()' function.  That
function no longer actually opens the repository (so the 'dry_run'
argument is gone, and instead a successful 'is_git_repository()' is
followed by 'opn_git_repository()' if you actually want the old
non-dry_run semantics.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2022-04-17 22:14:34 -07:00
Dirk Hohndel
acc4dc57af core: work around water temperature bug in Tecdiving DiveComputer.eu
It appears to send a first sample with a water temperature of 0 C. If the next
sample contains a more likely water temperature, overwrite the first one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-13 14:29:10 -07:00
Dirk Hohndel
514edfec07 build-system: work around latest GitHub Action issue
This suddenly started. A couple of build would fail because the git submodule
checkout fails because of directory ownership issues. Hopefully this will fix
it.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-12 23:35:25 -07:00
Dirk Hohndel
795cf1bee2 libdc integration: correctly parse DC_FIELD_SALINITY response
libdivecomputer tries to be super careful in what it tells us. It only offers a
density value if that is something that the dive computer explicitly supports,
otherwise it just offers back a flag. We need to then update the density value
ourselves.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-12 22:29:17 -07:00
Dirk Hohndel
ecfbf2a9ba update libdivecomputer
- Genesis React Pro: fix serial number
- OSTC: use deco model instead of dive mode for deco model information

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-04-04 14:36:56 -07:00
Michael Andreen
be2bdb8650 undo: Clear undo stack on file close
The undo stack is only relevant to the dives that were loaded at the
time the command was executed. If a file is closed, by specifically
closing it or opening another file, then the undo commands will
reference dives that aren't available anymore. Clearing the undo stack
ensures that we don't crash or accidentally do some undefined
modifications to the currently open file.

Signed-off-by: Michael Andreen <michael@andreen.dev>
2022-04-03 08:34:39 -07:00
Berthold Stoeger
ada4632ff1 profile: remove last dc_number access from profile code
dc_number is a global variable indicating the currently displayed
dive on desktop. It makes no sense on mobile, since multiple
profiles can be active at the same time. Therefore, the profile
code should not access this global, but use the dc number that
is passed in.

This removes the last access.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2022-04-03 08:29:05 -07:00
Robert C. Helling
96e825fb2e Allow more than one media file when importing from the web
To import media files from the web, increas the size of the
dialog box and allow several URLs separated by newlines.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
2022-04-01 08:28:05 -07:00
Anton Lundin
bc2de35242 configure-dc: Add support for ostc3 Auto SP mode
Way back in time, in HwOS 1.86 a CCR mode was added which automatically
switched between setpoints based on depth.

This entry was never added in our system to configure the dc, and caused
the issue seen in #3304

This adds the Auto SP mode, to the dropdown, thus fixing #3304.

Signed-off-by: Anton Lundin <glance@acc.umu.se>
2022-03-28 13:46:37 -07:00
Dirk Hohndel
f1c1e0ccee prepare for 5.0.8 release
I forgot to clean up the CHANGELOG file for the previous release, and some of
the commits in this release were missing CHANGELOG entries.

This should make sense now.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-27 17:41:24 -07:00
Dirk Hohndel
fe53644150 translations: fix Portuguese parent translation
I didn't pay attention and entered the wrong flavor of Portuguese as the
parent translation. The one for Portugal is complete and should be the
parent, back-filling the one for Brazil where needed.

Suggested-by: Christof Arnosti <charno@charno.ch>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-27 17:11:05 -07:00
Dirk Hohndel
b3a55e145f Latest translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-27 17:07:45 -07:00
Quentin Young
7136ee463c core: allow separators ,; after degree-style coord
Tweak the Lat/Long coordinate parser to allow coordinates of the form:

12.1049° N, 68.2296° W

The coordinate parser works by tokenizing coordinates one at a time.
Consequently it is invoked twice on user input to get latitude and then
longitude. Normally, after parsing the first coordinate, intervening
characters such as , or ; and any whitespace would be discarded from the
input before parsing the second coordinate. Prior to this patch, if the
coordinate format was in degrees followed by a sign (N is a sign in this
example), the parser would skip the bit of code that fast forwards past
any intervening separators and whitespace (, in this example). This
resulted in coordinates of this form not being accepted, because the
second parse would start with , 68.2296° W and reject this as an invalid
coordinate.

To rectify this, the bit of code that fast forwards past separators and
whitespace has been broken out from the tokenization loop and performed
as a final step after a single coordinate has been completely parsed and
validated. Doing it this way makes it independent of the state of the
tokenizer, so that the fast-forward code will always execute once a
coordinate has been successfully parsed.

I've also centralized the list of allowed separators into its own static
string; this is necessary as part of the patch but should also make
allowing additional separator characters between coordinates trivial in
the future, if needed.

Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2022-03-27 16:37:10 -07:00
Quentin Young
dbbb39e0f7 CODINGSTYLE.md: note that macros should be caps'd
Signed-off-by: Quentin Young <qlyoung@qlyoung.net>
2022-03-27 16:37:10 -07:00
Dirk Hohndel
9745f80431 translations: load parent language translations
Many language have country specific differences. We recognize different
flavors of English (US, UK (and South Africa)), German (Germany and
Switzerland), and Portuguese (Brazil and Portugal). For many other
flavors of the languages that we have translations for we have no
support and the way we hard-coded the fallbacks in the past was odd and
meant that in the cases where we do have two flavors, missing strings in
one weren't taken from the other (English as the default language being
the exception).

This tries to do a better job of recognizing some of those parent
languages and loading translators for them, first. Which means if we
then find a translator for the specific language (i.e., de_CH), strings
missing in that translation are next searched in the parent language
(de_DE), before finally providing the source language string (en_US).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-26 14:10:16 -07:00
Dirk Hohndel
0a8344e613 Latest translations from Transifex
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2022-03-26 07:54:04 -07:00