aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-09-09DLF import: Record battery statusGravatar Miika Turkia
This will record the ending battery status to extra data. Would need info from CCR divers whether this suffices or if we should record also the starting volatage or even every single reading. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-09-07tests: update qPref* to the shadow variableGravatar jan Iversen
The shadow variable causes properties only to be saved when actual changed, therefore some test cases need update Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-07core/settings: only sync values that are actually changedGravatar jan Iversen
Add a variable reflecting the current_state to all DISK_* macros, in order to check if the original variable in struct preferences is changed. Only save to disk if actually changed [Dirk Hohndel: merged Jan's commit and renamed the variable and adjusted the commit message... but fundamentally the commit is still what Jan wrote, so he should get the credit] Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-07qPref: use helper function to ensure key/name groupingGravatar Dirk Hohndel
We had a couple of instances of names being incorrectly merged with their group, this should handle that better. It's a bit of a big hammer to use, but it seems to work (and it makes it easy to then git grep for cases that don't use the new helper function. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-07Cleanup: constify threshold pointers in DiveProfileItemGravatar Berthold Stoeger
These were pointers into the global prefs object. The user must not use these to modify the settings, therefore make them pointers-to-const. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-07Cleanup: constify get_units()Gravatar Berthold Stoeger
get_units() returns a pointer to the units struct in the preferences. Callers should not modify the preferences via this struct, therefore make the return value point to const. This is a small step in constifying the global preferences structure. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-07Preferences: more missing /Gravatar Jan Mulder
subsurface_webservice_uid ends up in the wrong group due missing /. Notice that this does not fix the issues I mentioned in #1648. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-06Garmin devices - like Shearwater - want random BLE addressingGravatar Linus Torvalds
We had a special-case for the Shearwater case, let's just make it slightly more generic and add Garmin to the list of vendors that want a random BLE address rather than a static one. The Bluez model of having to state this explicitly - but not giving the information to the user - is completely broken and this is all very annoying, credit goes to Wojciech Więckowski for pointing this out. Of course, right now we don't actually know how to parse the BLE stream from the Garmin Descent, but with this (and some libdivecomputer hackery) I actually get connected and start receiving data. That we then can't parse, but that's hopefully just a libdivecomputer update away. Pointed-out-by: Wojciech Więckowski <xplwowi@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06core/settings: add missing / in default_filenameGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-06Revert "core/tests: add loadFromCloud var to qPrefCloudStorage"Gravatar jan Iversen
This reverts commit b7a1bb670ce11b22e52361f4152b4853b97e13f5. Signed-off-by: Jan Iversen <jani@apache.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06qPref: only save settings that aren't the defaultGravatar Dirk Hohndel
This brings us back to the previous behavior. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-06mobile_widgets: correct cloudCredentials save problemGravatar jan Iversen
When installing for the first time cloudCredentials needs to be added, this commit a problem with updating them correctly this problem was caused by da6e8a4cd5d80a4288129bf44b1efad69de1704f Signed-off-by: Jan Iversen <jani@apache.org>
2018-09-06[smtk-import] Apply arrays to the main smartrak_import() functionGravatar Salvador Cuñat
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06[smtk-import] Remove now unused smtk-value-by-idx()Gravatar Salvador Cuñat
Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06[smtk-import] Apply arrays to parsing tables functionsGravatar Salvador Cuñat
And add a fuction to parse tables that are not "relational", meaning tables which are directly refered from Dives table. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-06[smtk-import] Add a function to get the size of an arrayGravatar Salvador Cuñat
We can allocate fixed size arrays for smartrak tables as its size can be known in advance. Simply reading table->num_rows is too dangereous as smartrak tables have "holes" commonly. This is, they can look like: Idx | Txt 1 | blablabla 2 | blebleble 4 | blobloblo table->num_rows would give us 3, but we need to allocate 4 to get an array like: |0|blablabla |1|blebleble |2| |3|blobloblo as the idea is to use the table index to reference the array data. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-09-05Travis: use system libgit2 on OpenSUSE for Qt56 buildGravatar Dirk Hohndel
This is libgit2 0.24 which is new enough for our purposes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05build-system: don't show spurious errors looking for qmakeGravatar Dirk Hohndel
And improve the message if we do indeed not find it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05Travis: fix qt56 buildsGravatar Dirk Hohndel
This seems very strange - but it appears that we are missing the 'which' command. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05Another update to libdivecomputerGravatar Dirk Hohndel
Parse more Garmin Descent events. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05Update translation source stringsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05Update CHANGELOGGravatar Dirk Hohndel
A couple of updates that hadn't made it into the CHANGELOG. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-05Update libdivecomputerGravatar Dirk Hohndel
Dirk Hohndel (4): garmin: ignore FIT files that aren't dives garmin: extract the devinfo from the first FIT file we parse garmin: adjust the model to reflect the FIT product code Garmin: don't assume that the first device index is 0 Linus Torvalds (5): Add support for DC_SAMPLE_TTS - time to surface in seconds Garmin: add DC_SAMPLE_CNS reporting garmin: don't suppress the time sample at zero time garmin: start decoding notifications and gas change events garmin: improve on debug log output for unknown fields Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-04Update CHANGELOG for RFC 1587Gravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-04Desktop: buddies in the dive listGravatar Jan Mulder
As proposed in RFC #1587, now also alllow buddies to be shown in the divelist. Fixes: #1587 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-03Build: suppress inconsistent-missing-override warnings on clangGravatar Berthold Stoeger
In a previous commit all override-modifiers were thrown out owing to warning floods caused by the inconsistent-missing-override flag on clang. Re-adding overrides is now very painful because it's an all-or-nothing thing. Let's disable the warning for now. If we reastablished good coverage with override, we might think about re-enabling the warning. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-03libdivecomputer: allow a "zero depth" deco stop depthGravatar Linus Torvalds
That just means that we're not in deco, the same way as giving a nonzero NDL value does. But if you don't have NDL, this is a much more convenient way of saying "not in deco". The Garmin Descent gives us stop information, but not necessarily NDL, and really wants this. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-09-03libdivecomputer: add support for DC_SAMPLE_TTS if it existsGravatar Linus Torvalds
libdivecomputer didn't use to have a TTS sample value, but we're adding one, so add conditional support for it if it exists. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-09-03CHANGELOG.md: update with the latest Win32 log files changeGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-09-03core/windows.c: write logs to the user pathGravatar Lubomir I. Ivanov
Writing logs to the path where the executable is located, might not be possible if the current user doesn't have permissions to write there. Obtain the user path and write the log files to the user path instead - e.g.: c:\users\myuser\appdata\roaming\subsurface\subsurface_*.log Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-09-03code/windows.c: add method for converting from utf16 to utf8Gravatar Lubomir I. Ivanov
Modify the funcion system_default_path_append() to both receive and return wchar_t types. Remove fallback in system_default_path_append() as this is now redundant. Add a function utf16_to_utf8() and use that in places where system_default_path_append() needs to be converted to utf8. Move both utf16_to_utf8*() and utf8_to_utf16*() near the top of the file. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-09-01Desktop: allow using a file dialog to find Garmin folderGravatar Dirk Hohndel
If we don't auto-detect where the Garmin Descent is mounted, the user can either just type in the correct path, or can use a file diealog to specify it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-01Update to latest libdivecomputerGravatar Dirk Hohndel
This adds support for the Garmin Descent, among other changes. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-01Cleanup: silence clang missing braces warning in core/color.cppGravatar Berthold Stoeger
C++11 initializer lists should be passed via {{ ... }}. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-09-01Desktop: fix warnings when building preferences UIGravatar Dirk Hohndel
Fixes #1618 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-09-01Cleanup: make DiveTripModel a global objectGravatar Berthold Stoeger
DiveTripModel (the model describing the dive-list) was destroyed and recreated on every reset of the list. This seems excessive. Instead - in analogy to most other models - make it a single global object. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-31Filter: sort filter items in FilterModelBase::updateList()Gravatar Berthold Stoeger
All callers of FilterModelBase::updateList() sorted the items (except the last one). Thus we can do the sorting inside the function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-31Filter: Make FilterModelBase a proper Qt model (mostly)Gravatar Berthold Stoeger
Since FilterModelBase now contains complex data (counts and checked), we might just as well make it a full model and keep track of the name as well. I.e. do not derive from QStringListModel but from QAbstractListModel and add the name to the item structure. Implement proper reset / add / rename semantics. This is overkill at the moment, as after all any modification the model will be reset, but ultimately it will allow us to be smarter and only update rows when needed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-31Filter: remove diveSiteAdded signal of MainTabGravatar Berthold Stoeger
Signals can be useful. In this case, a simple function call does it. Thus, remove the signal. It can be readded later at an more appropriate place. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-31Zero initialize deco state structGravatar Robert C. Helling
Valgrind found use of some uninitialized variable (probably ds->gf_low_pressure_this_dive ), see #1614. Zero is the correct value to start with. Lacking a working version of valgrind I cannot check this actually fixes the problem. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-08-31Travis: show performance test resultsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-31Travis: put large test data in place for TestParsePerformanceGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-31Add performance test caseGravatar Dirk Hohndel
This requires the user to manually copy the large test file into the dives directory (because I really don't want to add this to the repo); instructions how to do that are displayed if the file is missing. Next it uses the git version of that same file (but prefetches it to try and remove the network speed from what is being measured). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-30Parser: split out name-comparison from match() functionGravatar Berthold Stoeger
The match() function in parse-xml.c calls a very specific callback, which doesn't take a context-parameter. To be able to call other callbacks, split out the actual name-comparison. Moreover, remove the "plen" parameter, as this was called with strlen(pattern) in all cases anyway. Replace the old logic which potentially accessed a byte beyond the end of name with a simply classical C-style loop. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-30Parser: move match() into core/parse-xml.cGravatar Berthold Stoeger
The match() function compares a pattern with a name with a twist: The name may either end in '\0' or '.'. If pattern and name match, a parsing function is called on a buffer and a destination value. The result of the parsing is not checked. This seems awfully XML-specific and therefore move the function from the general parse.c to the specialized parse-xml.c unit and make it of local linkage. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-30core/settings: add missing load_* call in qPrefDisplayGravatar jan Iversen
Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-30core/settings: add READMEGravatar jan Iversen
Add simple explanation of how the program flow is. Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-29parse "GPS" string fields and turn them into dive sites when downloadingGravatar Linus Torvalds
Dive computers that do GPS can report their GPS data as one or more string fields, and if the first tree letters of the description is "GPS", then we'll take the string and turn it into a dive site for that dive. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-29Dive trips: don't crash on repeated trip-removalGravatar Berthold Stoeger
In the UI it is possible to remove a dive from a trip twice, which leads to a crash, because trip is NULL (obviously). Instead of doing a proper fix (don't show the "remove from trip" entry in the first place), ignore dives without a trip, since a rewrite of the undo-code is planned for the medium future anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-29Revert "desktop-widgets: remove QSettings from desktop-widgets"Gravatar Dirk Hohndel
This reverts commit 321a920a9873a3828a24c1b28cf8eb5fe1bff2cb. It appears that the load_xxx functions aren't called, so while the correct values are stored to the settings, they aren't retrieved. Let's revert while this gets fixed. Fixes #1609 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>