Commit graph

15555 commits

Author SHA1 Message Date
Berthold Stoeger
a70597b903 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-03-18 09:06:32 -07:00
Dirk Hohndel
69248141c5 Core: remove variable name conflict
Having a parameter with the same name as a global variable is potentially
confusing.

Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-17 15:11:31 -07:00
Dirk Hohndel
b457965f50 Core: remove variable name conflict
Having a parameter representing a location with the same name as a global
variable representing our locale is confusing.

Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-17 15:11:31 -07:00
Dirk Hohndel
8bbc375fab Core: remove variable name conflict
Having a parameter with the same name as a global variable is potentially
confusing.

Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-17 15:11:31 -07:00
Dirk Hohndel
6a6c62ecf5 Core: remove function list comment
We don't do this anywhere else.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-17 15:11:31 -07:00
Dirk Hohndel
a31a9d0911 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-03-17 15:11:31 -07:00
Dirk Hohndel
2d26300402 Core: cast before multiplication to avoid potential overflow
Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-17 15:11:31 -07:00
Dirk Hohndel
47f92b92ac 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-03-17 15:11:31 -07:00
Michał Sawicz
412c242c10 [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-03-17 11:27:09 -07:00
Michał Sawicz
2af1e23b2c [snap] add missing source: stanzas
snapcfraft no longer defaults to `source: .`

Signed-off-by: Michał Sawicz <michal.sawicz@canonical.com>
2019-03-17 11:27:09 -07:00
Dirk Hohndel
f3d98518d5 Bluetooth: don't free a resource created by new
Found via LGTM.com

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-17 11:23:49 -07:00
Dirk Hohndel
87eb95d004 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-03-17 11:23:49 -07:00
Dirk Hohndel
3d193c7fdb 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-03-16 21:54:55 -07:00
Dirk Hohndel
0a25b32ca0 Cleanup: deal with lgtm.com Alerts
Small, obvious fixes.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-16 20:25:24 -07:00
Dirk Hohndel
d04a018020 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-03-16 20:24:08 -07:00
Dirk Hohndel
4dd6b82634 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-03-16 20:24:07 -07:00
Dirk Hohndel
2b5d818d35 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-03-16 20:24:04 -07:00
Rolf Eike Beer
7b1d5c5b8d JavaScript: remove needless variable assignments
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-16 10:06:26 -07:00
Rolf Eike Beer
2f6f48adec mark JavaScript variables as local
Found by LGTM.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-16 10:06:26 -07:00
Rolf Eike Beer
0fb66fc91f simplfy scripts
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-16 10:06:26 -07:00
Rolf Eike Beer
41410fe218 TravisCI: there are only VM builds now
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-16 10:06:26 -07:00
Berthold Stoeger
5cd64d42e4 Map: create correct index in updateMapLocationCoordinates()
When updating the coordinates of a dive site, the MapLocationModel
is updated. The code created a (col, row) index with col = 0.
[The idea of course being col = x, row = y]. Alas, that's not
how Qt works - its models want (row, col) indices. The code
worked, because the only time when the dive site locations were
updated was in dive site edit mode, when only one site is visible,
i.e. there is only one row leading to the correct (0, 0) index.

Fix this so that we can also change dive site positions if more
than one site is displayed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-15 07:40:13 -07:00
Doug Junkins
bc9a62c0ff Update CHANGELOG.md to show depth and temp stats feature
Signed-off-by: Doug Junkins <junkins@foghead.com>
2019-03-14 21:41:58 +01:00
Dirk Hohndel
c922a56495 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-03-13 16:27:12 +13:00
Dirk Hohndel
590f3c60bf Update to our latest libdivecomputer
- ignore empty pressure samples from OSTC
    - skip empty Oceanic logbook entries
    - update Ratio parsing
    - Shearwater: fix (again) per-cell ppO2 reporting

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-12 20:24:02 -07:00
Doug Junkins
a0f9957bce Display statistics by depth and temperature in Yearly statistics
Create a label for each line added for the depth and temperature
statistics buckets

Add line to statistics widget for each bucket to be displayed

Signed-off-by: Doug Junkins <junkins@foghead.com>
2019-03-12 00:53:51 +01:00
Doug Junkins
4613321e3e Add backend support for statistics by depth and temperature
Added stats_t structures to summarize dive statistics by depth and
by temperature.

Process each dive to add the dive stats to the proper depth and
temperature bucket. Buckets are defined using constants
STATS_MAX_DEPTH, STATS_DEPTH_BUCKET, STATS_MAX_TEMP, and
STATS_TEMP_BUCKET which are defined in statistics.h

Signed-off-by: Doug Junkins <junkins@foghead.com>
2019-03-12 00:53:51 +01:00
Rolf Eike Beer
62c6a19744 CMake: get rid of QT_EXTRA_LIBRARIES
This can be easily derived from QT_EXTRA_COMPONENTS.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-09 09:51:55 -08:00
Rolf Eike Beer
17211acc53 remove obsolete workaround for libdivecomputer includes of libusb
This has been fixed in revision b1d434f0ea9a2958613da9bed32ff3ff3318065e there.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-09 09:51:55 -08:00
Rolf Eike Beer
3664cc4ee6 Android: factor out duplicate version string search
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
9bbb6f785c CMake: just tell CMake to not find HTTP_Parser
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
aa7f9a18f2 simplify sed hacking of Qt CMake files
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
f667129ed9 CMake: simplify check if library was found
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
f555fa787f CMake: simplify writing qt.conf on Windows
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
b702e8e225 CMake: tell the Intel compiler to use the correct C/C++ standards
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
47e9a771ba CMake: do not expand variables in if-expressions
CMake will do the expansion internally itself. Not doing it here is not only
less code, it also makes sure one does not accidentially get a double expansion.

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Rolf Eike Beer
69508d7123 CMake: simplify checking if policy can be set
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-05 13:27:54 -08:00
Berthold Stoeger
9b5f6e16e1 Import: fix infinite loop
Owing to a variable reuse in a nested loop, importing dive logs
with new trips could lead to an infinite loop. Use a fresh index "j".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-05 13:03:43 -08:00
willemferguson
e4a1991e0c User manual: Text for Filter Tool
The description of the Filter tool is brought up to date.
One image is replaced elsewhere in the manual to reflect the
new Subsurface window top bar that indicates number of dives.
In total, 4 images added and text for user-manual updated.
The location of the filter text in the usermanual has been
changed.

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2019-03-05 13:03:13 -08:00
Doug Junkins
a29f7b7b32 Add support to compile from source on a Raspberry Pi
Update CMakeLists.txt to test if the CMAKE_SYSTEM_PROCESSOR variable is
either armv6l or armv7l. If so, add libGLESv2 to the list of libraries
to be linked to support openGL on embedded systems.

Update INSTALL file to list the packages needed to be installed on
Raspian Stretch or Ubuntu Mate to successfully compile subsurface from
source.

Signed-off-by: Doug Junkins <junkins@foghead.com>
2019-03-05 09:01:22 -08:00
Willem Ferguson
10e7835290 Filter panel: add suit and notes search fields
All the field in the Notes Panel of the main window are now supported.
This needs some testing especially for the Notes field that may contain
markup. It appears ok to me for single term searches. One would like
to think about the default search option for the Notes.
There is a vertical spacer in the Filter panel that I moved downwards
and whose function I am not quite sure of.

[Dirk Hohndel: small adjustments]

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-02-28 15:45:42 -08:00
Berthold Stoeger
01e8a54f58 Cleanup: remove DownloadFromDCThread::tripTable
Since ff9506b21b the downloaders don't
add dives to a new trip and therefore the tripTable field of
DownloadFromDCThread became pointless. Remove it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 15:31:48 -08:00
Berthold Stoeger
65267599f7 Cleanup: remove outdated comment in libdivecomputer.h
The comment was mentioning a "progressbar_t", which doesn't exist
anymore.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 15:31:48 -08:00
Berthold Stoeger
91ff7b68f0 Cleanup: remove dc_user_device_t::preexisting
This field appears to be unused for a long time.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 15:31:48 -08:00
Berthold Stoeger
8cde21a41d Cleanup: remove dc_user_device_t::trip
Since ff9506b21b the downloaders don't
add dives to a new trip and therefore the trip field of dc_user_device_t
became pointless. Remove it.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 15:31:48 -08:00
Berthold Stoeger
a729911893 Uemis: remove trip deletion on dive deletion
Since ff9506b21b the downloaders don't
add dives to a new trip, but the import code does. Remove the
code in the Uemis downloader that would remove a dive from the trip.
The code has been broken recently anyway (instead of testing for trip,
it tested for the notrip flag, which make no sense whatsoever).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 15:31:48 -08:00
willemferguson
2cda456282 Append the dive mode as a tag that is seen by the filter tool.
This allows one to filter dives by divemode, e.g. by typing
"CCR" or "Open circuit" in the tags textbox of the filter tool.
Quite useful if one dives using more than one dive mode. For the
purpose of the filter tool only the dive mode attribute is added
to the list of tags for the specific dive being considered. The
tag list for the same dive (in the XML dive log) is not affected
in any way.

Provide for translation in alternative languages (Response to
bstoeger's suggestion).

Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2019-02-28 07:29:15 -08:00
Alexander Wilms
22f98b0a16 Update appdata screenshots
Signed-off-by: Alexander Wilms <f.alexander.wilms@gmail.com>
2019-02-28 07:28:01 -08:00
Berthold Stoeger
416401a301 Cleanup: put all function declarations in file.h in extern "C"
Some of the functions declarations were not in 'extern "C"',
despite being C functions. This worked only because they weren't
called from C++. Nevertheless, it seems like a dangerous proposition
to have the same function declared once as C and once as C++.
Therefore, always put them in extern "C" (if compiling in C++ mode,
evidently).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 07:27:10 -08:00
Berthold Stoeger
155260e6d9 Cleanup: make dt_dive_parser() local to datatrak.c
The function is only used in this translation unit.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-02-28 07:27:10 -08:00