aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-07-04Dive pictures: remove hashesGravatar Berthold Stoeger
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>
2018-07-04Dive pictures: find moved pictures based on filenameGravatar Berthold Stoeger
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>
2018-07-04Dive pictures: index local file name by canonical filnameGravatar Berthold Stoeger
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>
2018-07-02Add CHANGELOG.md entryGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-03Dive pictures: remove unnecessary check for no divesGravatar Berthold Stoeger
This fixes a bug introduced in fbe1144eaf7e800a014c7a97b846835ba9f3bc7f: 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>
2018-07-02Correctly recognize more OSTC variants as BLEGravatar Dirk Hohndel
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>
2018-07-02Use (and update) dive computer times when merging and splitting divesGravatar Linus Torvalds
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>
2018-07-02Use proper sample pointer when deciding to split divesGravatar Linus Torvalds
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>
2018-07-02List Ubuntu 18.04 packages needed for build.Gravatar Martin Měřinský
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>
2018-07-01core: remove prefs-macros.h where unusedGravatar jan Iversen
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>
2018-06-29Dive pictures: adjust rowDDEnd and rowDDStart on picture deletionv4.8.0Gravatar Berthold Stoeger
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>
2018-06-28Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-29Dive pictures: connect DivePictureModel signals in constructorGravatar Berthold Stoeger
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>
2018-06-28Dive pictures: render icons with white instead of transparent backgroundGravatar Berthold Stoeger
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>
2018-06-28Android: limit the amount of data copied to clipboardGravatar Dirk Hohndel
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>
2018-06-28iOS and Android: try more logfile locationsGravatar Dirk Hohndel
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>
2018-06-28QML UI: provide information why logfile couldn't be writtenGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-28Add Cressi Giotto, Newton and Drake to list of devicesGravatar Stephen Goodall
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>
2018-06-27QML UI: fix layout of Download pageGravatar Dirk Hohndel
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>
2018-06-27QML UI: remove unused propertyGravatar Dirk Hohndel
We always save the libdivecomputer log. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-27QML UI: go back to always saving libdivecomputer logfileGravatar Dirk Hohndel
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>
2018-06-27Update list of supported dive computersGravatar Dirk Hohndel
This is simply extracted from libdivecomputer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-27Update libdivecomputer submoduleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-27Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-28Add Cressi Leonardo to list of devicesGravatar Stephen Goodall
Adding Cressi Leonardo to the list of devices that can be selected on Android devices. Signed-off-by: Stephen Goodall <stephen.goodall88@googlemail.com>
2018-06-26Documentation: update french manualsGravatar Guillaume GARDET
Signed-off-by: Guillaume GARDET <guillaume.gardet@opensuse.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26desktop: fix multi-keystroke input on locationGravatar Murillo Bernardes
When the tooltip is hidden QInputMethodEvent is handled by QLineEdit and works properly. When the tooltip is visible DiveLocationListView gains focus and receives QInputMethodEvent, without handling them properly. This patch just forwards the event back to the QLineEdit object. Fix #1405 Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2018-06-26Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26Update list of support dive computersGravatar Dirk Hohndel
This is simply extracted from libdivecomputer. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26Update README.md for 4.8Gravatar Dirk Hohndel
And mention the continues releases on GitHub. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-26QML UI: don't use anchors within LayoutsGravatar Dirk Hohndel
Qt 5.11 adds useful warnings when code attempts to use anchors within Layouts and even tells you how to fix things. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25Update mailmapGravatar Dirk Hohndel
Might as well get it right... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25ReleaseNotes: start preparing for 4.8 / 2.1Gravatar Dirk Hohndel
Move changes from CHANGELOG to ReleaseNotes and add a few items that were missing. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25tools: keep the log of translation extractionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25build-system: detect libdivecomputer changes in MXE buildGravatar Dirk Hohndel
Automatically trigger a rebuild of libdivecomputer if it has changed since the last build. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25QML UI: correctly update the modelGravatar Dirk Hohndel
In order to trigger the redraw of an edited dive we need to make sure the model realizes that it has been updated. So far the only way to make sure this happens reliably appears to be to remove the item and re-insert it. Seems weird, but with this the bug of not redrawing the profile after an edit appears fixed. Fixes #1419 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-25CSV import: support \n as new line on notes fieldGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-06-24Documentation: update CodingStyle.md with more details on translationsGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24Localization: make cache thread safe and robust against use-after-freeGravatar Berthold Stoeger
The old trGettext() was not thread-safe and the returned C-strings could be freed in the case of empty translations strings. Therefore: 1) Introduce a mutex protecting access to the cache. 2) Never change existing entries, even if the translation string is empty. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24Localization: remove gettextFromC::instance()Gravatar Berthold Stoeger
There were a handfull instances of the kind 1) gettextFromC::instance()->tr(...) 2) gettextFromC::instance()->trGettext(...) 1) is pointless, as tr is a static function. All instances of 2) were likewise pointless, because trGettext() returns a C-string, which was then immediately converted to a QString. Thus, replace both constructs by gettextFromC::tr(...). After this change there was only one user of gettextFromC::instance() left, viz. the C-interface funtion trGettext(). Therefore, remove gettextFromC::instance() and do all the caching / translating directly in the global trGettext(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24Localization: don't go via C-string in qthelper.cppGravatar Berthold Stoeger
The purpose of the gettextFromC class is twofold: 1) It provides a static storage of C strings if the C part needs a translation and doesn't want to deal with memory-management. 2) It severs as a catch-all class for translations that do not come from a proper class (i.e. from helper functions). The second case was used a few times in qthelper.cpp. By using the trGettext() function, a cached C-string was obtained. But in every single instance, this C-string was then back-converted into a QString. Therefore, use the gettextFromC::tr() function directly, which returns a QString. Not only is the resulting code simpler - this also avoids superfluous caching of translation strings. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-06-24Fix interpretation of dive mode changes upon replanGravatar Robert C. Helling
... by taking into acount that dive planner points refer to the sement before the waypoint (while change mode events are concerned with the future of a waypoint). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24Make planner notes divemode aware...Gravatar Robert C. Helling
... and fix a problem with setpoint changes shown in the wrong line Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24When adding new waypoints, use previous setpoint.Gravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24Planner: Change segment setpoint according to divemodeGravatar Robert C. Helling
When making a segment non-CCR, its setpoint should be 0. OTOH, when it becomes CCR, use the default setpoint (or should we try to find the last previous setpoint?) Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-24Copy divemode to ReplanGravatar Robert C. Helling
this needs copying the divemode from the dive to the plan. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-06-23Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-06-23Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>