aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-01-08Refactor CSV importGravatar Miika Turkia
Move CSV import related functions into import-csv.c. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add test for DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08DL7/zxu sample diveGravatar Miika Turkia
Manually crafted sample dive demonstrating parts of the DL7 format. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-07Fix small memory leakGravatar Jan Mulder
When deleting a dive from the divelist model, also free the pointed to DiveObjectHelper data. There seems no harm done (other than a memory leak) by this missing free. Found while (again) investigating the infamous crash occuring when deleting a dive from the mobile app when deleting a dive from the dive list. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-07Remove redundant call to clear_dive_file_data()Gravatar Berthold Stoeger
In QMLManager::saveCloudCredentials(), clear_dive_file_data() was called just before calling openLocalThenRemote(). The latter calls the former anyway, so remove the former. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Update CHANGELOG.md concerning cloud online/offline changesGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Remove cloud_background_sync preferences optionGravatar Berthold Stoeger
The preferences flag cloud_background_sync used to be used heavily in the mobile code, but is not used there anymore. Now, it is accessed only in one place, but does not do what it actually says: If it is off, the remote storage is not synced on save (but will be synced on next load). Syncing on save can also be prevented by unchecking the "Cloud online" menu checkbox. Since the latter seems more logical and general (support for non-cloud remote git repositories), remove the cloud_background_sync option. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Enable cloud-online menu entry only if connected to cloudGravatar Berthold Stoeger
Enable the menu item cloud-online only if the current file is the cloud storage. Since this has to be checked every time the current file is set, factor this out into the new MainWindow::setCurrentFile() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Turn take-cloud-online menu action into checkboxGravatar Berthold Stoeger
Replace the "Take cloud storage online" menu entry by a "Cloud online" checkbox. After this change, the user can also force going offline. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Sync cloud storage on take-cloud-onlineGravatar Berthold Stoeger
When taking the cloud online, actually sync with the online cloud storage. If there are no unsaved changes, do the same as "Open cloud storage". If there are unsaved changes, ask the user if they want to commit them (do the same as "Save to cloud storage") or if they want to sync manually. If syncing failed, inform the user. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Sync with any remote git repositoryGravatar Berthold Stoeger
Sync with remote git repository, even if this isn't the cloud storage. There seems to be no point in remote git repositories if they aren't synced. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06Do not save WebserviceID in preferences until asked forGravatar Jan Mulder
Do not save the WebserviceID in the preferences until we ask for this. That is simply wrong. This is definitely not a full fix for all the weirdness that is going in related to the WebserviceID but saving the ID even if we do not ask for it, adds to possible confusion. To always automatically pull in the ID from the server based on cloud credentials, just leave the ID field empty in the network preferences. Fixes: #1013 (well ... a tiny part of this mess) Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06Trivial: remove redundant declarations of downloadTableGravatar Berthold Stoeger
downloadTable was declared twice in "dive.h". Remove one occurence. Moreover, "uemis-downloader.c" also declared downloadTable. This can likewise be removed, because "uemis-downloader.c" indirectly includes "dive.h". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-06cleanup: use new urlsGravatar Jan Mulder
Just rename some old hohndel.org urls Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06cleanup: localize global variableGravatar Jan Mulder
Not needed to be global. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06Remove unused urlsGravatar Jan Mulder
They are unused, and a relic from earlier plans. Just remove. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-06GPS: use applyGpsLocation::applyLocations from coreGravatar Jan Mulder
Fixes a big duplication of code. The code to apply GPS locations from the location service was already in core, and used from mobile, but there was an almost literal copy in the desktop code. See also commits 6f42ab46da1b59 and ee9531f76ec31a, where only one side of the duplicated code was fixed. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-05core: free() in a safe way, reverse geolookup unstabilityGravatar Jan Mulder
A simple one line change that solves (for me) numerous hard crashes when adding geo tags by reverse lookup from the dive site edit screen. This is one of those crashes that is might not be reproducible on any platform, or even between different builds on one platform. This said, I found that the free() on line 99 of divesitehelpers.cpp tried to free pointers to random data, ie. not pointing to valid taxonomy category strings. And those pointers where simply caused by freeing the string earlier, and leaving the pointer around. So, this change is nothing more than setting the just freed pointer to NULL, to allow free() to be called later safely. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-04Update libdivecomputer submoduleGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-01-05Increase size of name_buffer to fit any integerGravatar Berthold Stoeger
In libdivecomputer.c, name_buffer is formatted with calls like snprintf(name_buffer, 9, "%d cuft", rounded_size); This works fine in the regular case, but it generates compiler warnings, since theoretically the integer might produce up to 11 digits, leading to a truncation of the string. Increasing the size of name_buffer to 17 chars silences these warnings. This may seem like pointless warning-silencing. Nevertheless, in the case of invalid data, it might make debugging easier since, in the above case, the "cuft" is never truncated. In total, it seems that this is a benign change with potential, though in a very unlikely case, positive effects. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-05Don't define cur_setting in header fileGravatar Berthold Stoeger
The object cur_setting was defined in core/pref.h. Instead, declare it as extern and define it in core/parse.c. This silences a compiler warning, since inclusion of core/pref.h would define the object, which was then left unused in tests/testparse.cpp. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04parse-xml.c: add get_bool() functionGravatar Berthold Stoeger
The boolean "autogroup" was parsed as an integer. In principle OK, but let's make the type more explicit by introducing a get_bool() function. Suggested-by: "Lubomir I. Ivanov" <neolit123@gmail.com> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Replace BEHAVIOR macro by initializer listsGravatar Berthold Stoeger
The macro BEHAVIOR expanded to "QList<int>()". This was used to generate temporary QList<int>s with constructs such as BEHAVIOR << COLLAPSED << EXPANDED Instead, simply use initializer lists such as {COLLAPSED, EXPANDED} Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Replace macro TOGGLE_COLLAPSABLE by function toggleCollapsible()Gravatar Berthold Stoeger
There was no reason to do this in a macro. Let the compiler decide if it wants to inline or not. Note that for consistency with the Qt functions, collapsAble was replaced by collabsIble. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Use set_autogroup() functionGravatar Berthold Stoeger
Since this function exists, use it instead of setting the global variable directly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Turn autogroup from short into boolGravatar Berthold Stoeger
All users of autogroup are clearly expecting a boolean value, so let the type reflect this. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04mark_divelist_changed(): only update title if necessaryGravatar Berthold Stoeger
Only change the title if the changed status was updated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-04Turn dive_list_changed into boolGravatar Berthold Stoeger
All callers of mark_divelist_changed() were passing a bool. Therefore, let mark_divelist_changed() take a bool and make dive_list_changed a bool. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-03mobile: silence warnings in the app logGravatar Jan Mulder
The new SHA mysteriously caused more than 300 extra warnings in the app log. It was caused by a code change in Kirigami. The way to suppress it is, in hindsight, after some hours of searching, trivial. A Kirigami.BasicListItem shall have an icon defined. And as we do not care about any icon here, just define it empty. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-03mobile: newer Kirigami SHAGravatar Jan Mulder
This commit consists of the following 3 parts: 1. There are 2 source files added, adapt our build process accordingly. 2. Due to a change in icon and kirigami QML prefixes, we need to adapt for this as well. Changed mobile-resources.qrc for that. When this would not be changed, the icons will not be found. 3. To further prepare for the future, abandon the iconName property in favour of the new icon grouped property, which can have more attributes than only the name. But currently it is only a syntactic change. Tested on Android device, and no visible changes. Signedoff-by: Jan Mulder <jlmulder@xs4all.nl
2018-01-02Update CHANGELOG.mdGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-01-02Enable translation of ctrl key name for tool tip in dive notesGravatar Stefan Fuchs
This really enables the translation of the ctrl key name. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-02Cleanup: Rename preferences ui file names according the standardGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-02Remove leading space from kg/l units for salinityGravatar Stefan Fuchs
Change this according to our standard of NOT having a leading space before any unit. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-01-02Desktop: follow autogroup setting in UIGravatar Jan Mulder
When importing a dive (using import from logfile) and it is a ssrf/xml file that contains the autogroup setting, the autogroup is effectuated in the dive list. Not sure that I like this behavior, but thats the way it currently is. Simply wrong is that in this case the menu item toggle is not adapted so we end up with a dive list that is autogrouped, but the menu toggle is off. This can be solved by setting the UI toggle in a more central location. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-01-01desktop: clear tags when hitting new logbookGravatar Jan Mulder
A very simple commit to start 2018. When hitting new logbook from a currently open logbook, and the current dive has tags filled in, they stayed around in the UI. Just clear them. Further, delete an unused variable. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-31divesite.c: use union in create_divesite_uuid()Gravatar Lubomir I. Ivanov
The return produces a warning about "strict-aliasing rules". Use a union to fit the hash and the uint32_t into the same block of memory, which obeys the GCC strict-aliasing rules. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2017-12-31Workaround for invalid bluetooth device namesGravatar Berthold Stoeger
Owing to bug #1002 invalid bluetooth device addresses of the form "devicename (deviceaddress)" or "deviceaddress (devicename)" may have found their way into the preferences. Recognize such names and extract the correct address. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-31Get Bluetooth device nam from preferences if dialog wasn't shownGravatar Berthold Stoeger
If the BT dialog hasn't been shown, the device name was taken from the text field, which contained a formatted string. The device open would then fail. Fixes #1002 Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-30Use our fork of uploadtoolGravatar Dirk Hohndel
And use the 'correct' URL to obtain the actual file. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-30Cleanup: consistently handle file open failuresGravatar Dirk Hohndel
In part based on Coverity CID 45129 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-30Cleanup: fix memory leakGravatar Dirk Hohndel
Oops, I previously fixed only one of two instances. Coverity CID 45078 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-30A few more updates to Copyright noticesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-30Get ready for 2018Gravatar Jan Mulder
Copyright strings updated. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-30Add tool tip for negate filter buttonGravatar Stefan Fuchs
Add tool tip for buttons introduced in: b6bf57a13b5e4d3dd469b0fa8790d341eb4f1304 Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-30Reenable pressure interpolation in context menuGravatar Robert C. Helling
This fixes a bug reported by Willem that removing waypoints using the right click context menu makes the cylinder pressure lines partly disappear. The reason was that clicking a dive handler disables the pressure interpolation (and other things, controlled by shouldCalculateMaxdepth). This is turned on again upon the mouse release event. This event is not triggered when selecting in item from the context menu (like remove waypoint or gas selection) so we need to send it manually. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-29Latest translationsv4.7.6Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-29cleanup: less than operators shall not use equalGravatar Jan Mulder
See also commit c032006d91ee3c. Compare functions passed to sort functions need to compare for less-than and not less-or-equal. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-12-29Desktop: Don't hide errors on opening cloud storageGravatar Berthold Stoeger
In MainWindow::on_actionCloudstorageopen_triggered(), getNotificationWidget()->hideNotification() was called, thus hiding any error message produced by the cloud code. Notably, the information "Cannot sync with cloud server, working with offline copy" was not shown. Therefore, remove this call. Note that on cloud save messages were not hidden. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-29cleanup: Uninitialized scalar fieldGravatar Jan Mulder
CID 208303 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>