Commit graph

13946 commits

Author SHA1 Message Date
jan Iversen
6e253fa04f core/ssrf.h: add #pragma to avoid clang warning "-Wmissing-field-initializers"
Add a #pragma to avoid getting warning when a struct is only initialized
with one 0 and not one pr struct member

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
jan Iversen
a243977026 core: add ssrf.h as global product header
ssrf contains macros/includes etc. used in ssrf, but
not related to dives (mainly in dive.h)

currently the header is created to add the macro UNUSED
later it will be used to remove non-dive related items
from dive.h

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
jan Iversen
ce800310a4 profile-widget: replace (void) with no parameter name
Unused parameters in C++ are "silenced" by removing the name.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
jan Iversen
cb9951a484 desktop-widgets: replace (void) with no parameter name
Unused parameters in C++ are "silenced" by removing the name.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
jan Iversen
12b4f2235b core: replace (void) with no parameter name
Unused parameters in C++ are "silenced" by removing the name.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
jan Iversen
99acff1b05 mobile: application variable unused in main
Simplify starting application.
instead of declaring var. application, and the setting unused,
simple do the "new QApplication" without a variable.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
Berthold Stoeger
21ee440e5f Cleanup: remove code related to picture-storage in git repositories
Saving of pictures to git repositories was disabled. Finally remove
this code and the corresponding load code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-24 08:27:10 -07:00
jan Iversen
0958592ee6 subsurface: update .gitignore with extra dirs.
make sure "git status" does not report know dirs.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:24:53 -07:00
jan Iversen
ee86fecbbf build-system: integrate get-dep-lib in mobilecomponents
use get-dep-lib in mobilecomponents to do git clone of
kirigami and breeze-icons.

Remove -no-pull option

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:24:53 -07:00
jan Iversen
d18ede2cff build-system: get-dep-lib add support for kirigami and breeze-icons
mobilecomponents.sh do git clone of kirigami and breeze-icons.
should be centralized with get-dep-lib

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:24:53 -07:00
Gaetan Bisson
d3af836467 Fix includes for building against Qt-5.11.0
Signed-off-by: Gaetan Bisson <bisson@archlinux.org>
2018-05-23 13:29:37 +03:00
jan Iversen
708d69343d mobile: removing print mode from mobile.
print mode was used to limit the functionality of the profile,
when used in ssrf-mobile.

The effect is that DC events are displayed, but not selectable

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:59:08 -07:00
jan Iversen
065af62f59 profile-widget: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
f92daa456a desktop-widgets/statistics: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
2b84482787 desktop-widgets/.../facebook: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
e536682b84 desktop-widgets: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
e47f6df076 subsurface: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
b0e48a5e8f qt-models: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
52031f0aba core/subsurface-qt: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
a312e53f0c core: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
jan Iversen
034f9a6ca2 mobile-widgets: Change Q_UNUSED to no parameter name
C++ permits use of parameters without name, which signals unused

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 12:48:04 -07:00
Berthold Stoeger
f47f2773fd Dive pictures: don't repopulate DivePictureModel on deletion
On deletion of a single or multiple pictures, the whole DivePictureModel
was repopulated, which was clearly visible in the UI, owing to the
reconstructing of all images in the profile plot.

To avoid this vexing behavior, implement proper deletion routines in
DivePictureModel and ProfileWidget2. Since this needs sensible erase()
semantics the QList<PictureEntry> member of DivePictureModel was
replaced by a QVector. A QVector should be the default anyway, unless
there are very specific reasons to use a QList (which actually is
a deque, not a classical linked list).

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-21 22:17:28 +03:00
Berthold Stoeger
3c0c1801cd Dive pictures: change removePicture() interface
The function removePicture() had a flag "last", which would indicate
that the called had finished removing pictures. Only then would
the model be recalculated.

This is a strange interface and, matter of fact, the caller was buggy:
if the last picture to be removed didn't have a proper url, removePicture()
was never called with "last" being set.

Change the interface to take a list of pictures to be deleted. This
will allow us to make picture deletion smarter in follow-up commits.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-21 22:17:28 +03:00
Berthold Stoeger
fbe1144eaf Dive pictures: use modelReset signal when reseting picture list
In the old code a combination of removeRows()/insertRows() was used
to signal a model reset.

Replace this by a single, modelReset signal. This saves a call to
plotPictures() and will allow us to be smarter in the future,
when removing pictures.

Reset-model and remove-items are semantically different.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-21 22:17:28 +03:00
jan Iversen
3646fa800b iOS: copy libdivecomputer.log to clipboard
Read libdivecomputer.log file and append to clipboard

Remark, subsurface_open is not available in iOS so using
QFile instead.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
4a872f74a4 iOS: updated text in About to reflect logs not log
Both subsurface.log and libdivecomputer.log are on the clipboard.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
997251d43a iOS: store libdivecomputer.log in documents (same dir as app log)
Make location of subsurface.log and libdivecomputer.log consistent

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
571965ec6d mobile: removed setting for libdivecomputer.log
Users need a simple way to report download problems. Asking them
to go into settings, activate logging, and repeat the download
is too much.

libdivecomputer.log will always be generated, but overwritten, with every
download, so the latest log is ready.

The download is very slow due to BT, so there are no impact of having the log
active, neither in terms of size (a concern on small mobiles) or write time.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:57:14 -07:00
jan Iversen
67838de5bc iOS: qt-ble.cpp remove unsupported event.
QEvent::DeferredDelete is not supported in iOS

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:46:41 -07:00
jan Iversen
37ac354291 profile-widget: divepixmapitem.cpp, silence unused parameter
remove parameter name for not used parameter, to silence
unused warning.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:31:16 -07:00
jan Iversen
158be64883 profile-widget: profilewidget2.cpp, silence unused parameter
Add Q_UNUSED for not used parameter

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:31:16 -07:00
jan Iversen
46ff506096 build-system: iOS only turn off specific warnings
Turning off all warnings (-w) was too radical.

Only turning off specific warnings.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-21 07:26:56 -07:00
jan Iversen
d7e31ebbcd iOS: get rid of ios/Subsurface-mobile
Having a split between ios and ios/Subsurface-mobile is just confusing
and without a practical reason

Move files from ios/Subsurface-mobile to ios and update .gitignore

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
16555e663b iOS: remove duplicate of deployment.pri
one deployment.pri is enough

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
4c8ed5a5ae QML UI: allow changing the connection ID
When downloading with bluetooth, changing connection did not work.
The new selection was not passed to the download thread.

Fixes #1274

Signed-off-by: Jan Iversen <jani@apache.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
Dirk Hohndel
d8fa24dcd8 Travis: don't fail Linux build when .zsync is missing
It seems that sometimes the AppImage tooling gets confused and doesn't
create a .zsync file. That should cause Travis to fail.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-20 11:35:28 -07:00
jan Iversen
96079d7e6a build-system: libgit2 depends on libcurl and libssh2
When building with -builddeps on a "virgin" mac, configure
of libgit2 could not find libcurl and libssh2

moved building of libcurl and libssh2 in front of libgit2

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-20 08:12:10 -07:00
jan Iversen
aab33694f2 build-system: corrected -build-deps problem
Missed a "cd $SRC" so when building with
-build-deps the script broke

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-20 08:12:10 -07:00
jan Iversen
d8227c4a70 core: marked unused parameter
Add Q_UNUSED to unused parameter

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-20 08:11:29 -07:00
Dirk Hohndel
dce7e46766 Mac: don't try to copy libraries we got from Homebrew
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 21:22:31 -07:00
Dirk Hohndel
d417d717b9 build-system: change the logic when to build what
Specifically, don't conflate needing libgit2 with the Mac -builddep
argument, and when determining if we need to build libgit2 on Linux,
make sure to also check for a version that we may have built in a
previous run of the build.sh script.

This commit is much easier to understand with
  git show -w
as it contains quite a bit of simple indentation change.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 21:22:31 -07:00
Dirk Hohndel
14d18276e4 Travis: add secondary Linux build target
The goal is to reduce the overall wall clock time of our test builds.

This secondary Linux target uses the no-sudo container setup with a Qt
5.10.1 backport and tests the build without BT support as well as the
mobile build (but not the full desktop build and doesn't create an
AppImage as the pre-built Qt5.10.1 is missing QtWebKit).

In exchange we remove the no-bt and mobile build from the existing linux
target.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 21:21:46 -07:00
Dirk Hohndel
1faa5d7ae1 build-system: don't always build qtserialbluetooth.cpp
This should only be built if we have BT support enabled.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 16:49:05 -07:00
Dirk Hohndel
6a91611e90 build-system: updated OpenSSL and libusb for Android
These are the latest, supported versions for OpenSSL. I have not tested
if Android would work with OpenSSL 1.1.

The lower versio for libzip is still required as libzip 1.2.0 doesn't
compile for Android.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 14:15:11 -07:00
Dirk Hohndel
5047e90857 Android: set target API level to 26
This doesn't affect the minimum we support, but a target level of at
least 26 will be required starting in August in order to be able to
upload to the Google app store. This is equivalent to targeting Android
8.0. Google plans to bump this target API level every year.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 14:15:11 -07:00
Dirk Hohndel
5b9c28e1c0 Mac: support running Subsurface-mobile
Copy the required QML modules into the app bundle.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-19 14:13:46 -07:00
jan Iversen
95bfd3af29 iOS, supress warnings.
Changed .pro file to supress warnings
clang does not allow all of the issued warnings to be
supressed with -Wno-foo, so instead doing -w

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-19 14:05:23 -07:00
jan Iversen
090eb1ee34 iOS, remove linker warnings (version mismatch).
The Qt libraries are compiled as iOS 10.0, we link
as iOS 8.0, this is a problem waiting to happen. First
time we use a Qt function that uses a iOS 10.0 specific
function the app will crash.

Bumping iOS minimum version from 8.0 to 10.0
Removing the 76x icon, which are not valid from 10.0 and forward

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-19 14:05:23 -07:00
Berthold Stoeger
7836a78dca Profile: minor coding style issues concerning axis-ticks
1) Fix the English of a comment.
2) Remove a number of int-to-double compares:

Make "steps" an integer variable (the number of steps).
Rename the old double "steps" variable to "stepsInRange". This gives
a non-integer number of steps and is necessary to calculate the
correct step size

3) Replace a "x = x/y" by a "x /= y" construct.

4) Remove an unnecessary if clause.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-19 07:48:28 -07:00
Berthold Stoeger
555f2f9565 Profile: Fix leak in animation
If animDelete() was called with prefs.animation_speed == 0, the
object would not be marked for deletion, as opposed to calling
with prefs.animation_speed != 0. This would leak the objects.

Therefore delete the objects if called with prefs.animation_speed == 0.
The caller doesn't keep a reference to the objects. Therefore,
a plain delete is fine, as opposed to a deleteLater().

While touching this function, use the function-pointer version
of connect().

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-19 07:48:28 -07:00