Commit graph

13957 commits

Author SHA1 Message Date
Berthold Stoeger
b34eeeaba2 Cleanup: remove code related to pictures in the cloud-repository
Storing pictures in the cloud never came to be, so remove the code.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-26 09:23:49 -07:00
Berthold Stoeger
d7f5246d6b Cleanup: remove deleteLater() in QMLProfile
The actual profile object was destroyed with deleteLater() in the
destructor of QMLProfile. This is ominous, because the subobject
shouldn't survive the parent object.

Therefore, automatically destroy the profile by using a QScopedPointer.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-26 09:21:46 -07:00
Berthold Stoeger
d21d42b691 Cleanup: remove three instances of deleteLater() in mainwindow.cpp
deleteLater() can be dangerous. Remove where not necessary.

Analysis:

1) `helpView` was a pointer which was initialized on demand. close() and
deleteLater() were called on closure of the main window. Firstly, there's
no point in calling deleteLater(), because no references to helpView
are used later on. Secondly, the deletion (and closing) can be done
automatically in the destructor, by passing `this` as parent object.

2) `survey`: pretty much the same situation. But here, `this` was already
passed as parent object.

3) `progressDialog` is a global (not thread safe!) pointer. The object
is deleted after use. There is no point in using deleteLater(), because
the callers are not active after hideProgressBar(), which is the
place were the deleteLater() call was found.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-26 09:21:46 -07:00
Berthold Stoeger
0de862971e Cleanup: remove reply and request member variables in QMLManager
The reply member variable was used to access the reply in the
handleSslErrors, handleError and retrieveUserid slots. This is a
very scary proposition in the light of multi-threading. Instead,
the reply can be accessed by using the QObject::sender() function.
Thus, we can remove the member variable.

The request member was just downright weird. This was only used
locally to describe a network request. Since QNetworkAccessManager::get()
copies the request, it can be destructed right away. Nevertheless,
the data was kept as a subobject. Remove member and make it function-local.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-26 09:19:42 -07:00
jan Iversen
b18b10b467 build-system: added missing .git in get-dep-lib.sh
For unknown reasons cloning from github is slower to start if .git
is omitted.

Add .git to all "git clone" statements

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-25 07:39:08 -07:00
jan Iversen
b1b5028917 build-system: update get-dep-lib to not check double on iOS
Only mobilecomponents.sh download breeze-icons and kirigami.
This patch is merely to avoid confusion.

Before get-dep-lib in ios/download would download those, and
mobilecomponents would see that they were already downloaded.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-25 07:39:08 -07:00
Miika Turkia
c1a9eafa21 Add .mailmap to combine individual contributors
This will combine contributions to one identity even when using multiple
email addresses (or differences in real name). I.e. Tomaz had two
different identities in top 20 contributors list. Now
"git shortlog -sne" will show them all under one contributor.

Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
---
Not that this would really matter, but since we do run git shortlog -sne
to get stats we might as well get more correct results :D

I am sure there are still some mistakes as I used exact realname
matching in a longish shell one-liner, complemented with some manual
tuning for Willem and Robert as I spotted them to have some variations
on real name...
2018-05-25 15:52:09 +02:00
Berthold Stoeger
a76f15f0f6 Cleanup: Don't defer deletion of oldModel in DiveListView::reload()
There seems to be no point in using deleteLater() of the previous
model. Set the new model and delete the old one.

This fixes a crash with Qt 5.11.

Tested-by: Gaetan Bisson <bisson@archlinux.org>
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-25 14:15:42 +03:00
jan Iversen
86ab5a91f7 profile-widget: set printmode but allow events for ssrf-mobile
Reactivate printMode true for ssrf-mobile to avoid font problems,
do not discard events if ssrf-mobile (even though printMode is true)

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 12:04:14 -07:00
jan Iversen
a658f80e27 iOS: updated launchscreen so it is more centered.
The text and icon was so low, that the page started to scroll on
an iPhone (at least on a model 6s).

Anchored Text to top, and icon to text.

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 10:19:08 -07:00
jan Iversen
061be82e31 core: replace (void) with UNUSED(x) and include ssrf.h
Unused parameters in C are "silenced" by adding UNUSED(x)

Signed-off-by: Jan Iversen <jani@apache.org>
2018-05-24 08:34:14 -07:00
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