Commit graph

15220 commits

Author SHA1 Message Date
Rolf Eike Beer
c7e9825fc6 mark JavaScript variables as local
Found by LGTM.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-04 15:02:42 -07:00
Dirk Hohndel
30ea5aa9f6 Desktop: ensure cloud storage email address is all lower case
We already do that on mobile and I was certain we used to do this for
desktop as well, but apparently that got lost somewhere...

This should solve the problems we are seeing for people with mixed case
email addresses.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:01:37 -07:00
Alexander Wilms
268b453a81 Update appdata screenshots
Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2019-04-04 14:54:41 -07:00
Berthold Stoeger
a3a1a74d1f Edit: use correct offset when changing dive times
The undo-work reversed the direction of the offset. This was apparently
only fixed when using the menu entry, but not when editing dives directly.
Invert the offset to get the correct time.

While doing so, remove a redundant if: First it checked whether the
dates are the same, then whether the offset is non-zero.

Fixes #1975.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04 14:53:24 -07:00
Dirk Hohndel
736941870a core: move updatecheck to its own domain
This make it easier to move backend services around.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 14:52:31 -07:00
Lubomir I. Ivanov
e685e7e9de facebook: remove the featute from the code base
Remove from:
- unit tests
- desktop widgets
- preferences
- core intergration
- cmakefiles
- build scripts
- icons
- docs

Also remove the plugins and social network integration.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 10:24:01 -07:00
Dirk Hohndel
41de2f66e3 Update libdivecomputer
Shearwater: fix (again) per-cell ppO2 reporting
      Update the list of the Ratio dive computers
      Don't pass a NULL pointer to memcpy
      Use symbolic constants for the commands
      Add clock synchronization support
      Skip empty logbook entries
      Add filters for BLE communication
      Ignore zero tank pressure values

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 09:52:19 -07:00
Dirk Hohndel
a6e0cb79d1 Update to version 4.8.5
And cleanup (partially incorrect, due to cherry-picking) CHANGELOG.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-24 20:53:48 +13:00
Dirk Hohndel
2b9da3504b Android: accept 'Release' argument
This is mostly an artifact of how I build release packages. Otherwise
this likely isn't important.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-23 17:40:37 +13:00
Dirk Hohndel
e8c1ce7e2c Update Supported Divecomputers list
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-23 17:37:07 +13:00
Dirk Hohndel
cb31d67f61 Update mobile version number
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-23 17:35:26 +13:00
Dirk Hohndel
ec8eac185b Bluetooth: don't crash if BT is turned off
At least on a Mac we can get here without a discoveryAgent if BT is off,
so don't derefence the NULL pointer in that case.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-23 14:35:23 +13:00
Dirk Hohndel
95e6f0c700 Update libdivecomputer
shearwater: properly initialize the string caches
    Shearwater parser: add new harware model nr for Teric
    Merge git://github.com/libdivecomputer/libdivecomputer into Subsurface-NG

    Update with Jef's upstream:

     - add support for Cressi Goa and Cartesio

     - update the Shearwater PNF parser to Jef's version

     - misc minor fixes

    * git://github.com/libdivecomputer/libdivecomputer:
      Use the timezone setting of the dive computer
      Add support for the Cressi Goa and Cartesio
      Add an extra parameter for the initial CRC value
      Add support for the Ratio iDive Color series
      Shearwater Petrel Native Format parsing
      Shearwater: detect which logbook format is support
      Shearwater: add Teric to list of supported dive computers
      Shearwater: skip deleted dives
      Fix a potential buffer overflow

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-23 14:02:27 +13:00
Dirk Hohndel
0e1bd02df6 BLE debug: make things less verbose
Unless run with '-v -v -v'.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:07:26 +13:00
Dirk Hohndel
c000123121 libdivecomputer: small wording change in a warning
While in theory the DEVINFO event should give us the correct detected
product, it's also possible that the code that usually detects the
product gave up and returns an unknown model.

Try to have the message reflect that situation more accurately.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:07:19 +13:00
Dirk Hohndel
50eec0231c Windows/MXE: actually build HIDAPI library
Otherwise Suunto EON Steel & EON Core, Scubapro G2 & Aladin Square and
other, future USB HID dive computers won't be supported on Windows.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:07:04 +13:00
Dirk Hohndel
37be26bd8d Android: make sure we have the correct platforms installed
This should fix the current Travis build failures for Android.
It is odd how we have ANDROID_PLATFORM and ANDROID_PLATFORMS,
buf for now all I care about is that the Travis build completes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:06:50 +13:00
Robert C. Helling
fc66c767fb Don't allow empty username for git
When no real name is set in /etc/passwd the username ends
up being ",,,". Git does not like that. Actually, only the
part before the first comma is the name, the rest is office
and phone number. We don't want those.

Before we only testing for the username being a NULL pointer.

Reported-by: Keith Grimes
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2019-01-22 13:06:17 +13:00
Berthold Stoeger
7598e2fce7 Download: don't refresh display if thread finished
After the downloading finished, the mainwindow-display is reset
via a signal. This is probably an artifact of old times, when
downloading was done into the main dive-list. Nowadays, this seems
to make little sense, as the main dive-list is not changed by download.

Remove the signal.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-01-22 13:06:01 +13:00
Jan Mulder
4b42837327 Travis: OpenSUSE 42.3 / Qt5.6 build issue, use openssl and no libressl
... and remove install of the default (old) libgit2 from OS. That old
(0.24.0) libgit2 will be replaced by a newer anyway, so useless to
install.

But the real change to get this Travis build running again is using
the well known openssl instead of libressl.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:06:01 +13:00
Dirk Hohndel
3c5c0185dd Travis: OpenSUSE 42.3 / Qt5.6, add missing curl
The install was missing curl.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl> Removed upgrade to newer libgit2.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:06:01 +13:00
Jan Mulder
78ad59b22f Build: build libgit2 from source when less than 0.26.0
We currently require a minimal version of libgit2 of 0.24.0. From
issue #1926 it seems that this version is too old. So, a simple test on
Linux to see the behaviour with such an old libgit2, I tried that.
Interestingly, with the current version of openssl that old libgit2
version does not even compile from source (known error in libgit2).

So, bump our minimal version of libgit2 to 0.26.0. That is also the
version we currently use on the Travis and official builds, so well
tested.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:06:01 +13:00
Dirk Hohndel
0bd75c8e9e build system: try harder to checkout the right version
And actually fail a build if that doesn't work.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:05:03 +13:00
Miika Turkia
ddac55a3f1 Use state structure for sample rate info
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
5a9a7f005f Shearwater Cloud mentioned in changelog
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
39d5860602 Use correct value for PO2
averagePPO2 appears to be correct value instead of currentPPO2SetPoint.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
6aa51c6232 Grab correct setpoint on Shearwater cloud import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
f78f3075c4 Use different time field as it seems to be more correct
The starTimestamp is 4 hours apart on 2 different DCs within the sample
log. DiveDate on the dive_logs table seems to be correct, but must be
converted from human readable format.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
4aac746bf0 Sample rate varies between dives
Seems that Shearwater cloud stores sample rate into the database and
it is not constant within the log.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
f5ef586c72 Initial support for Shearwater Cloud
This works to some extent to part of a sample log I received. However,
still quite a bit more work is needed.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:36 +13:00
Miika Turkia
536017f42e Shearwater import: dive id might be large than int
I encountered this while implementing Shearwater Cloud import, but it
makes sense to increase the size for dive id for Shearwater Desktop as
well.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2019-01-22 13:04:13 +13:00
Lubomir I. Ivanov
9b0b5fd489 update year to 2019 in about screens
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2019-01-22 13:03:25 +13:00
Dirk Hohndel
4935f07c9a Desktop: change preferences dialog name to 'Preferences'
Fixes #1912

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:03:13 +13:00
Dirk Hohndel
9e83106ff7 Travis: use 5.12.03 Docker image for Android
With this we have working arm and arm64 images (except that the arm64
image crashes when using Bluetooth).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
ee53639306 Android Dockerfile: add latest cmake 3.13.2
cmake 3.10 (which comes with Ubuntu 18.04) in combination with Qt 5.12
and the current qt-android-cmake causes an odd bug. Paths are set with a
double slash at the start '//' and later in the process this causes
garbled path names for some of the objects which in return causes the
APKs built in the container to fail.

Upgrading the cmake inside the container to 3.13.2 fixes that problem.

All the credit for identifying the problem and figuring out a solution
goes to Jan Mulder.

The resulting container was pushed to Docker hub as version to 5.12.03.

Reported-by: Jan Mulder <jlmulder@xs4all.nl>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Jan Mulder
e964bae5b9 Android Docker: give the docker build its own output tree
Again, this is relevant for developers that do local docker android
builds, and normal android builds. A normal build uses the directory
subsurface-mobile-build-arm(64), and when doing a docker android build
this directory is shared between host and container. That sharing is
good, as it nicely exposes the build tree to the host (for easy compare,
inspection, etc.). But reusing the same tree as the local one is
inconvenient (and possibly dangerous due to all kinds of caching
issues).

So, give the docker build its own output tree for the shared
subsurface-mobile-build-arm(64) build output.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Jan Mulder
968b7c1f7c Android Docker: give the android builder its own name
Users that use docker locally for Windows style build and Android style
builds will (probably) not like that we use the same name for both
docker containers. So, give the android builder its own name.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Jan Mulder
a875fd0d44 Android build: always reconfigure libdivecomputer
This fix makes no difference from usage of this script in Travis
context, as every build starts from a clean VM, but the very few
developers that build for Android locally, and that want to use the new
style docker container builds as well, things are broken.

libdivecomputer has build artifacts in its source tree (and that source
tree is shared between local and docker run). So it happens that
libdivecomputer is configured locally, and afterwards fails to build
in docker build as its already configured, but not for the docker
image its now running in.

The fix is simple. Always reconfigure libdivecomputer when using this
script.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
86d3e59d70 Android: build both 32 and 64 bit binaries
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
55a0bed59f Travis: find the Android apk in the right spot
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
2153b95bf6 Travis: Android build wrapper now runs inside our container
So we don't need the pre-built binaries anymore, and we don't need the
travis_wait hack anymore for potentially slow downloads as that is all
installed in the container already.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
071bce0fd1 Android Dockerfile: ugly hack to deal with current NDK compile problems
As explained in commit 449d4ee33d ("Android build: add explanation for
huge hack").

It seems reasonable to add this to our Travis image as that is custom
made just to build our Android binaries.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
af6da3090a Android Dockerfile: add comments and try to shrink the image more
This image is downloaded on every Travis run. Making it smaller is important.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
8628567e31 Travis: build against the Qt 5.12 Android image
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Dirk Hohndel
247513ad08 Android: update for Qt 5.12.0
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-01-22 13:02:39 +13:00
Jan Mulder
94fa935818 Android build: add explanation for huge hack
This had to be embedded in the build process (or better, solved for
real).

Using Cmake, Clang, NDK 18b, Qt 5.12 beta 4, some Subsurface code does
not compile. At this point in time, its fully unclear to me why we see the
error as it is.

Thing fail deep down in Qt and NDK headers on #include <cmath>. Error like
"::signbit is not in the global namespace". The most logic reason is an
improper order in which include paths are constructed in the build process.
Any attempt to find the real reason failed. Even very similar command lines
from a qmake build that succeed fail with a cmake style build.

The very very dirty hack is commenting out some lines in NDK 18b:

"./android-ndk-r18b/sources/cxx-stl/llvm-libc++/include/cmath

Comment lines 313-325, and all build, links and runs with no errors
related to this known at this point.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Jan Mulder
1e0ac92dd7 Android build: always use -fPIC
make sure that all lib code is compiled with -fPIC as things will not
link due to error "requires unsupported dynamic reloc R_ARM_REL32" (for
arm build).

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Jan Mulder
5f0ce37559 Android build: build openssl before libzip
On very clean builds not using the wrapper script, the compile of libzip
simply fails because it depend on openssl include files. Simply swap them
around.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Jan Mulder
7f4180a777 Android build: fix openssl build, no_asm
Mysteriously, openssl does not compile with clang with a
sha256-armv4.S:2638:2: error: invalid instruction, did you mean: adr?
The easiest way out is compiling without no_asm. This obviously lowers
the bandwidth on the SSL link (as the asm code is there for performance
reasons), but it has no visible performance loss in my tests.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00
Jan Mulder
b29a6e4cd2 Android build: add arm64 target and compile with clang
With a preparation done in the 4 commits before, now add the arm64 and
use clang instead of gcc as compiler infrastructure.

Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2019-01-22 13:02:39 +13:00