Commit graph

15250 commits

Author SHA1 Message Date
Robert C. Helling
c6732e9b26 Export profile image
With Facebook support gone, we should offer a way to export
the profile image. This has been part of the TeX support
but this makes it explicit.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-08 09:54:19 +03:00
Dirk Hohndel
3998cb8245 Update libdivecomputer
Shearwater Teric: add support for the TAG INFO_EVENT

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-08 08:17:49 +03:00
Dirk Hohndel
fec354075f Update CHANGELOG.md
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:22:39 -07:00
Jonas Jensen
a85598a0e7 Ubuntu 18.10 LGTM build
I'm about to update the build environment on lgtm.com from Ubuntu 18.04 to 18.10, and this breaks your project. It appears that [libgit2 now depends on libmbedtls](https://packages.ubuntu.com/cosmic/libgit2-dev), and it [didn't do this before](https://packages.ubuntu.com/bionic/libgit2-dev). By default, your project links statically with libgit2, but static linking requires specifying all dependencies of the library, and your builds doesn't specify libmbedtls. I'm working around the problem here by passing the `LIBGIT2_DYNAMIC` option to your CMake script, which makes libgit2 dynamically linked, and dynamically linked libraries don't need to have their transitive dependencies specified.

I'm taking this opportunity to make a few more changes to `.lgtm.yml` to prevent problems in the future when we upgrade the build environment.
1. Pass `-DNO_DOCS=ON` to avoid building things we don't need.
2. Pass `DCMAKE_VERBOSE_MAKEFILE=ON` for ease of debugging build problems.
3. Remove the manual list of dependency packages and instead rely on LGTM's automatic dependency detection. The manual dependency list contained version numbers and was therefore not likely to keep working over time. The automatic dependency detection only works in the `configure` and `index` steps, so I moved some lines from `after_prepare` to `configure`.

Signed-off-by: Jonas Jensen <jonas@semmle.com>
2019-04-04 15:18:40 -07:00
Dirk Hohndel
6bf980d85e Profile: ensure the correct settingsChanged() function is called
Found via LGTM.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:18:18 -07:00
Dirk Hohndel
c792c00f07 Core: simplify ConnectionListModel
The complicated setup with the AddressRole is unnecessary. All we want to be
able to do is get the index of a specific text in the list. In hindsight I am
puzzled why I implemented this in such a complex fashion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:18:07 -07:00
Dirk Hohndel
f1371adbb8 Misc: replace some FIXME comments
All these aren't actually things that need fixing, they are observations about
the code.

Given that LGTM.com reports FIXME comments as Alerts, let's change the ones
that aren't about things that need fixing to something more harmless.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:17:06 -07:00
Robert C. Helling
43fb4ef36b Desktop: fix another variable name conflict
Addresses LGTM.com issue.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:16:09 -07:00
Robert C. Helling
1f9d7f29c5 Desktop: fix yet another variable name conflict
Addresses LGTM.com issue.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:15:59 -07:00
Robert C. Helling
d6a5fc5386 Core: let TTS calculation use correct ascent velocities
Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:15:47 -07:00
Robert C. Helling
faf34db515 Core: change FIXME language
Addresses LGTM.com issue.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:15:34 -07:00
Robert C. Helling
f4021bcecd Core: fix another variable name conflict
Addresses LGTM.com issue.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:15:20 -07:00
Robert C. Helling
101be9e967 Core: remove variable name conflict
Addresses LGTM.com issue.

Signed-off-by: Robert C. Helling <helling@atdotde.de>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:15:07 -07:00
Berthold Stoeger
167b41b6e5 Cleanup: unglobalize variables in datatrak.c
It's a drop in the bucket, but let's remove some unnecessary
global variables. With one exception these variables were only
used in one function anyway. The other one can be passed as a
parameter.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04 15:14:25 -07:00
Berthold Stoeger
5c625d8116 Cleanup: remove unused global variables from datatrak.c
lector_bytes and lector_word were used nowhere.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04 15:10:48 -07:00
Dirk Hohndel
450bad9d7b build-system: LGTM: don't warn about short global names
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:10:00 -07:00
Berthold Stoeger
ac71705b53 Leak fix: make ostcFirmwareCheck a unique_ptr
ostcFirmwareCheck in DownloadFromDCWidget was neither freed
in the destructor, not freed if a new object was allocated.

Simply make it a unique_ptr<> to do all the work for us.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04 15:09:31 -07:00
Dirk Hohndel
072bf67303 Core: remove variable name conflict
Having a char parameter with the same name as a global char * variable is confusing.

Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:07:00 -07:00
Dirk Hohndel
421e093afd Core: cast before multiplication to avoid potential overflow
Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:06:46 -07:00
Dirk Hohndel
7a9203eda2 Core: cast to the correct type
While in the specific calculations here there isn't really a risk that float
might overflow, it seems odd to cast to float in order to assign to double.

This caused an Alert via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:06:32 -07:00
Michał Sawicz
d1b4669304 [snap] pull the desktop-qt5 part in
snapcraft doesn't support remote parts any more, and there's no
extension (the replacement for remote parts) for Qt yet.

Signed-off-by: Michał Sawicz <michal.sawicz@canonical.com>
2019-04-04 15:06:18 -07:00
Michał Sawicz
737d8f9c9e [snap] add missing source: stanzas
snapcfraft no longer defaults to `source: .`

Signed-off-by: Michał Sawicz <michal.sawicz@canonical.com>
2019-04-04 15:06:02 -07:00
Dirk Hohndel
dbddbfeec3 Bluetooth: don't free a resource created by new
Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:05:19 -07:00
Dirk Hohndel
c93f7e4f8c Core: fix missing argument to report_error
The format requires a string argument.

Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:04:59 -07:00
Dirk Hohndel
9fefd10390 build-system: add script to build only libdivecomputer
This is used on LGTM (and initially got lost when I merged those changes).

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:04:42 -07:00
Dirk Hohndel
8889552b70 Cleanup: deal with lgtm.com Alerts
Small, obvious fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:04:12 -07:00
Dirk Hohndel
eb2f811be4 build-system: add LGTM yaml file
This should allow LGTM.com to build the C/C++ code.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:03:53 -07:00
Dirk Hohndel
72f37f14c6 build-system: explicitly add libgit2 dependencies for LGTM
For some reason on LGTM these two libraries aren't automatically added to the
link line for Subsurface.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:03:40 -07:00
Dirk Hohndel
5e192f3c6f build-system: try to find libdivecomputer on LGTM
On LGTM we end up installing in /opt/out.

Also, fix a silly error in the existing code - don't look for libraries in
include directories.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-04-04 15:03:14 -07:00
Rolf Eike Beer
c0421ab637 JavaScript: remove needless variable assignments
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-04 15:02:52 -07:00
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