This adds a file that contains the variables used in
the android-build-wrapper and build scripts.
This gives a single location for setting which versions
of Qt, NDK and SDK we use when building the mobile app on linux.
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
Because of the code cleanup in commit 57c01f7a66 ("Translations: unify
gettextFromC::tr() and QObject::tr()") a lot of text has moved to new
context.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
commit ec0511e824 ("ios: concentrate build dirs") moved the translations around
without updating the way they are accessed, causing our release 2.1.0 on iOS to
not be localized.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Only the first computer is taken into account to find
surface intervals. All further dive computers are split
according to time.
Signed-off-by: Robert C. Helling <helling@atdotde.de>
There were two catch-all classes for translations outside of class
context. gettextFromC was used exclusively from C, but C++ used
both, gettextFromC and QObject. Some of the string were even present
in both. Therefore, unify to gettextFromC throughout the code base.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Remove cloud_storage_status from qmlprefs.h.
usage to qPref::
enum cloud_storage_status is not used from C, but only from C++, and
having the same structure defined multiple times is a maintenance
challenge.
Signed-off-by: Jan Iversen <jani@apache.org>
add 2 header files and 1 cpp file (qPrefPrivate does not have an implementation)
The rewrite/consoliadation of SettingsObjectWrapper, qmlmanager, qmlpref and planner
needs a place to put common private parts (qPrefPrivate) and 1 common class (qPref).
Signed-off-by: Jan Iversen <jani@apache.org>
sort .c and .cpp files in CMakeLists.txt
The .c and .cpp files in CMakeLists.txt had no obvious sequence,
sorting it at least gives one understandable sequence
Signed-off-by: Jan Iversen <jani@apache.org>
PP_GRAPHS_ENABLED is only used in profilewidget2.cpp
make local to profilewidget.cpp
Signed-off-by: Jan Iversen <jani@apache.org>core/profile: move PP_GRAPHS_ENABLED from pref.h
But simply ignore when building outside of Travis.
Of course since we are building Android in a container, we need to first pass
the environment variable to the container...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
These come originally from https://github.com/travis-ci/travis-build and are
available when running on Travis, but not when running inside a Docker
container on Travis as we do in order to build for Android.
The goal is to provide a quasi heart-beat on STDOUT during very long running
commands - without this the wget to download Qt often times out, so that's
where we are going to use this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Move the find-moved-images functions into a new translation unit
and present the user with the identified matches before applying
them.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
In the last commits, the canonical-to-local filename map was made
independent from the image hashes and the location of moved images
was based on filename not hashes. The hashes are now in principle
unused (except for conversion of old-style local filename lookups).
Therefore, remove the hashes in this commit. This makes addition
of images distinctly faster.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Users might have edited their pictures. Therefore, instead of identifying
pictures by the hash of the file-content, use the file path. The match
between original and new filename is graded by a score. Currently, this
is the number of path components that match, starting from the filename.
Camparison is case-insensitive.
After having identified the matching images, write the caches so that they
are saved even if the user doesn't cleanly quit the application.
Since the new code uses significantly less resources, it can be run in a
single background thread. Thus, the multi-threading can be simplified.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The connection canonical filename to local filename was done via
two maps:
1) canonical filename -> hash
2) hash -> local filename
But the local filename was always queried from the canonical filename.
Therefore, directly index the former with the latter.
On startup, convert the old map to the new one.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This fixes a bug introduced in fbe1144eaf:
For an empty log, in DivePictureModel::updateDivePictures()
beginResetModel() would be called without a corresponding endResetModel().
It is unclear whether this can ever be hit, because in the no-dives
case, at least in the desktop version no profile is shown.
Note, that this makes the check double-unnecessary.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Some OSTC 2 and OSTC Plus variants show 'OSTC+ xxxxx' as BLE name and we
recognized this as OSTC 3 (but that one doesn't support BLE). With this
we recognize these models as OSTC 2 (which is identical from a download
perspective to the OSTC Plus) and both of those support BLE.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
When we split a dive in two, we keep the dive computer ID for the dive,
but we should update the actual _time_ of the split dive to match the
split.
And when we look for "are these the exact same dives", we should check
not only that the dive computer dive ID matches, but also that the dive
computer time matches, so that we don't consider two parts of a dive
that has been split to be obviously the same dive.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
The dive splitting was completely wrong, because we checked the time of
the previous sample by doing
sample[i - 1].time.seconds
which is entirely wrong. The 'sample' variable is the *current* sample,
so the time of the previous sample is simply
sample[-1].time.seconds
Alternatively, we could have started from the first sample, and done
dc->sample[i - 1].time.seconds
but mixing the two concepts up just gets you a random sample pointer
that is likely not a valid sample at all, and obviously does not have
the right time at all.
As a result, dive splitting was pretty much random. Sometimes it worked
purely by mistake, because the rest of the logic was right (ie we _had_
found the right point where we reached the surface in the dive etc, the
"previous sample time" was simply used to decide if the surface interval
was sufficient to split the dive up).
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Closes#1229
[Dirk Hohndel: minor white space adjustment]
Signed-off-by: Martin Měřinský <mermar@centrum.cz>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
move #include prefs-macros from SettingsObjectWrapper.h to SettingsObjectWrapper.cpp
include dive.h directly (only part of prefs-macros.h used) in preference classes
Signed-off-by: Jan Iversen <jani@apache.org>
In DivePictureModel, rowDDEnd and rowDDStart specify the range of
pictures in the profile plot. Obviously, these have to be adjusted
when pictures are deleted.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The DivePictureModel signals were connected int the setProfileState()
function of ProfileWidget2. If this function was called repeatedly
(e.g. after adding a dive), multiple connections were made, which led
to multiply delivered signals. This in turn led to confusion, when
deleting pictures (i.e. multiple pictures were deleted).
Instead, connect once in ProfileWidget2's constructor. It is unclear
whether these signals should be disconnected temporarily if no pictures
are shown. In any case, the weren't, so this shouldn't introduce any
regression.
Fixes#1441
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The SVG icons for failed / still-loading pictures were rendered with an
alpha channel. This lead to strange behavior when hovering over the
icon in the profile plot: When hitting a "hole" the icon would be
minimized again.
Therefore, render the SVGs onto a white background.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
The clipboard fails if we attempt to copy more than 1MB of data. But the
data buffer used is shared between all transactions 'in flight' and we
cannot tell what else is currently using that buffer. Limiting ourselves
to 500k of text for the logfiles seems reasonable and hopefully makes it
more likely that the transaction will succeed (sadly, Qt doesn't tell us
if it failed).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
On some devices (e.g., a Sony Xperia phone) the GenericDataLocation is
not app writeable. Instead of just giving app, try a few other default
locations as well (and since all of these are actually string lists,
try all of the options that Qt gives us).
Reasonably, we should only set the libdivecomputer logfile name if we
found a writeable location.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding Cressi Giotto, Newton and Drake to the list of devices
that can be selected on Android devices.
Signed-off-by: Stephen Goodall <stephen.goodall88@googlemail.com>
The info text from the download process wasn't rendered correctly.
maximumWidth ended being a recursive reference and as a result the text
would render as very narrow and super-tall field.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This got disabled as unintended (I hope) side effect of commit
807571a588 ("core: update deviceData default from qml").
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Adding Cressi Leonardo to the list of devices that can be selected
on Android devices.
Signed-off-by: Stephen Goodall <stephen.goodall88@googlemail.com>