aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
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>
2018-08-28core: fix typo in preference nameGravatar Dirk Hohndel
In commit 1bc361b2ea ("core/tests: add uuidString to qPrefUpdateManager") a typo was introduced for the preference name. Reported-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-28Cleanup: we don't support configuring a Uemis SDAGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-28Filter: cache number of dives fulfilling filter rulesGravatar Berthold Stoeger
Currently, in FilterModelBase::data() the number of dives is recalculated. This happens for every mouse-over event! Calculate the number of dives only on recalculation and store the count in the items-struct. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-28Whitespace: make range based for loops consistent in filtermodels.cppGravatar Berthold Stoeger
Consistently use "for(item: items)" instead if "for(item : items)". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-28Filter: replace checked-state by structGravatar Berthold Stoeger
In the future, we might be smarter about the dive-counts and calculate them only once and incrementally (if e.g. new dives are added). Prepare for more complex caching by turning the checked boolean into a struct, which can then be extended by a count and other things (e.g. the name). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-27Add support for opening a DC_TRANSPORT_USBSTORAGE streamGravatar Linus Torvalds
This is part of the whole "let's support the notion of dive computers being exported as USB storage devices" push. With an older libdivecomputer, we'll just fall back on failing the operation, but we still want to support the generic notion of DC_TRANSPORT_USBSTORAGE since we have our own internal Uemis downloader. That one won't ever get to the open phase, since it's caught earlier. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-27Make device enumeration use the device transport dataGravatar Linus Torvalds
This removes some special-case code for Uemis, replacing it with simply passing in the device transport information. This makes device enumeration work for the Garmin Descent (if it is listed by libdivecomputer as a USB storage device, that is). I don't actually do any of the libdivecomputer parsing yet, and only have a stub for the Garmin Descent, but now the directory selection works with that stub. The actual download obviously does not. [Dirk Hohndel: removed obsolete FIXME from code] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-27Treat the "GARMIN" mount point exactly like the "UEMISSDA" oneGravatar Linus Torvalds
The logic for finding a mount point for the Garmin FIT devices is basically exactly the same as for the UEMISSDA, even if the rest of the sequence is not the same. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-27Show new firmware notice for OSTC PlusGravatar Jan Mulder
Also show a new firmware notice for a HW OSTC Plus. This appeared to be broken (as can be verified on the current master from today, as HW just released version 2.98 of the firmware). Notice that there is some confusion in both Subsurface and Libdivecomputer with respect to types of OSTCs. Physcically, there exist 2 type of OSTC3's. The first edition with only DC_TRANSPORT_SERIAL (and an USB connector), and a second version that lacks the connector but supports both BT and BLE. Confusingly, the second version is marked OSTC3 on the device, but the user needs to select OSTC Plus (which is basically a 3rd version of the OSTC3, combined with a successor of the OSTC Sport) to download dives using BT/BLE. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-08-26CHANGELOG.md: update with the latest divelist columns fixGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-08-26divelistview: always show at least one columnGravatar Lubomir I. Ivanov
Currently it is possible to hide all columns by unchecking them in the context menu that appears by right clicking the header of the divelist. But once all are hidden the header disappears. This can cause a situation where the user cannot show any columns and the only fix for that is to edit the application configuration. To avoid this sutuation prevent the last column from being hidden. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-08-26CHANGELOG.md: add note for the latest dive list row height changeGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-08-26modeldelegates: use font metrics for dive list row heightGravatar Lubomir I. Ivanov
Include font metrics as part of the height in DiveListDelegate::sizeHint(). When 22px is hardcoded, this handles small fonts, but for larger fonts it seem that the bottom of the dive list row text is cut on Windows. Keep 22px as the minimum size hint, but for larger fonts use QFontMetric::height(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2018-08-25Merge branch 'filter8' of https://github.com/bstoeger/subsurfaceGravatar Dirk Hohndel
2018-08-25desktop-widgets: remove QSettings from desktop-widgetsGravatar jan Iversen
The variables referenced are moved into qPref in earlier commits so in general all QSettings calls are replaced by qPref*:: calls Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core/tests: add class var to qPrefGeneralGravatar jan Iversen
Add static class variables to qPrefGeneral (and remove QSettings from desktop-widgets) Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25mobile-widgets: remove QSettingsGravatar jan Iversen
update qmlprefs and qmlmanager to use qPref Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core/tests: add loadFromCloud var to qPrefCloudStorageGravatar jan Iversen
Add special property loadFromCloud + mail to qPrefCloudStorage this variable is used by qmlmanager.cpp Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core/tests: remove QSettings from testgitstorageGravatar jan Iversen
update testgitstorage.cpp to use qPrefProxy and qPrefCloudStorage remove core/prefs-macros.h since it is unused Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core: remove QSettings from qPrefDivePlannerGravatar jan Iversen
remove not needed include from qPrefDivePlanner Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25desktop-widget: remove QSettingsGravatar jan Iversen
Update desktop-widget to use qPrefDisplay (amended variable) Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25smtk_import: remove QSettingsGravatar jan Iversen
Update smtk_import to use qPrefDisplay (amended variable) Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25profilewidget: remove QSettingsGravatar jan Iversen
Update profilewidget to use qPrefDisplay (amended variable) Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core/tests: merge Animations and add vars. to qPrefDisplayGravatar jan Iversen
Add class variable tooltip_position to qPrefDisplay Add class variable lastDir to qPrefDisplay qPrefDisplay is updated to use new qPrefPrivate functions Adjust test cases incl. qml tests qPrefAnimations only has 1 variable, that really is a display variable Merge the variable into qPrefDisplay, to simplify setup (and avoid loading extra page in qml). correct theme to save in correct place, and make it a static class variable Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core: remove QSettings from qthelperGravatar jan Iversen
uiLanguage overloaded qPrefLanguage and used useSystemLanguage instead of use_system_language Replace local load using QSettings with qPrefLanguage Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core/tests: add uuidString to qPrefUpdateManagerGravatar jan Iversen
add static class variable uuidString to qPrefUpdateManager correct test cases Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core: qPrivate add handle macros for class variablesGravatar jan Iversen
Some variables are not in structure prefs, but are static class variables, these will not be synced on exit, because they can only be changed through the setter, but loaded on startup. Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core: make methods in qPrefPrivate staticGravatar jan Iversen
Small cleanup, using static methods is simpler and faster Added propSetValue and propValue instead of exposing setting variable. Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25core: qPrefPrivate.h correct spaces before \ in macrosGravatar jan Iversen
the ending \ in macros have been expanded to many spaces, correct back to 1 space Signed-off-by: Jan Iversen <jani@apache.org>
2018-08-25smtk-import: Apply lists to main smartrak_import() functionGravatar Salvador Cuñat
Previously we built arrays for the tables each time we parsed a dive. Now we simply build the lists once, and use them in each dive parsing. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-08-25smtk-import: move from arrys to lists while parsing tablesGravatar Salvador Cuñat
In most cases we can not foresee the maximum number of data of a given type. It can be quite low or really big (a concerned diver can store thousands of different fishes in Fish table). Moving from arrays, where size has to be preset, to linked lists seems the more logical option. Here we set a (very limited) data structure, just an index and a text fields following the format of most SmartTrak tables. Some special table, like Buddy, needs a bit of processing before placing the data in the list. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-08-25smtk-import: Do not set build type in CMakeLists.txtGravatar Salvador Cuñat
We set the build type from the building script. Setting this in CMakeLists.txt make the script setting useless and always build Release type. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com>
2018-08-25Update ChangelogGravatar Jocke
Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-25Mobile: add default cylinder UIGravatar Jocke
Add the UI components to let the user set the default cylinder and select the chosen cylinder when adding a new dive. Signed-off-by: Joakim Bygdell <j.bygdell@gmail.com>
2018-08-23Cleanup: const-ify functions taking dives and divecomputersGravatar Berthold Stoeger
Another small step in making things const-clean. See also commit 605e1e19ed0c52a16580c95e36ae79e71b539351. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-23Latest translationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-08-23Parse: pass dive_table argument to parse_file()Gravatar Berthold Stoeger
To enable undo of divelog-importing it is crucial that parse_file() can parse into arbitrary dive tables. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-23Cleanup: user properly typed pointersGravatar Berthold Stoeger
A trivial cleanup: replace void by properly typed pointers in cylinder_none() and weightsystem_none(). Moreover, remove the unused function no_weightsystems(). Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>