aboutsummaryrefslogtreecommitdiffstats
path: root/core
AgeCommit message (Collapse)Author
2017-12-04Gracefully handle deletion of a picture that doesn't existGravatar Berthold Stoeger
The list iteration in dive_remove_picture() was buggy and would crash if handled a picture that is not in the list. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-03Free unused git repository in git_create_local_repo()Gravatar Berthold Stoeger
In this function, a repository is created, but the returned object is not used. Might just as well free it. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-02Add debug output for vendor/product tuplesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-02Add Heinrichs Weikamp BLE dive computers for iOSGravatar Dirk Hohndel
Not all OSTC 2, 3, and Sport support BLE, but newer models do. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-12-02iOS: save BT DeviceInfo on discoveryGravatar Murillo Bernardes
On iOS save all discovered devices. Later qt_ble_open queries this list in order to actually connect to the remove device. The Desktop code stores this data with the list items and only saves when the "Save" button is clicked. This is not supported with the current ConnectionListModel implementation. Signed-off-by: Murillo Bernardes <mfbernardes@gmail.com>
2017-12-02Fix file:// handling for git access.Gravatar Berthold Stoeger
Currently, in is_remote_git_repository(), git URLs of the form "file://..." are recognized as local and the "file://" prefix is removed. The shortened URL is then processed as if it was a remote URL, which of course has to fail. So far so good - this is not a remote repository after all. But the removal of the prefix is not propagated to the calling is_git_repository() function and handling as a local git repository therefore fails likewise. To fix this issue, move removal of the "file://" prefix one level up to the is_git_repository() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-01Remove unnecessary #include and correct whitespaceGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-01Document background computation of variationsGravatar Robert C. Helling
Update changelog, update user manual, clarify meaning in dive notes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-01Disable plan variation in recreational modeGravatar Rick Walsh
Calculating variations when in recreational mode doesn't make sense, and can prevent variations from being calculated when switching back to Buhlmann or VPM-B modes. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com>
2017-12-01Round up diveplan duration the same way values in diveplan are roundedGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-12-01Actually compute variations in backgroundGravatar Robert C. Helling
This reenables the computation of plan variations but now in a separate thread. Once finieshed, a signal is sent to update the notes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-12-01Cut off excessive deco timesGravatar Robert C. Helling
before we run out of memory. Diving deep with air and small GFhigh can cause those (try GF 30/70 at 75m with 25+min bottom time) Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-29Fix signed/unsigned issueGravatar Dirk Hohndel
Also deal with an unused argument in the case of a Subsurface-mobile build. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-29Remove commented out codeGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-29Move Divinglog DB import into its own fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-29Move Cobalt DB import to its own fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-29Move Shearwater DB import into its own fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-29Move Suunto DB import into its own fileGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-28Merging dives: Improve merging of divemaster, buddy and notesGravatar Stefan Fuchs
Change the merging behavior for the following information: Divemaster, buddy, suit: From "(a) or (b)" to "a, b" Notes: From "(a) or (b)" to "a\n--\nb" Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Hopefully fix Android buildGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Move Cobalt and Divinglog DB parsing to parse-db.cGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Move atoi_n to parse.cGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Move Shearwater DB parsing into parse-db.cGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Move metric variable to parse.cGravatar Miika Turkia
This is required when moving Shearwater DB parsing into parse-db.c Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Move add_dive_site to parse.cGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Move Suunto DB imports into parse-db.cGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Refactore parse-xml.c into parse.c and parse-xml.cGravatar Miika Turkia
This should help us to move parsing that is not XML related to other files, hopefully making the code cleaner. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Code cleanup: Move index declarations into for loopGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Use MAX_SENSORS define everywhereGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Add debug function dump_cylindersGravatar Stefan Fuchs
This function can be used to dump print all cylinder data. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Compile dump_tissues function only if needed based on defineGravatar Stefan Fuchs
Compile it only when DECO_CALC_DEBUG is defined. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-27Store and load the planner related depth info of a cylinder in logfileGravatar Stefan Fuchs
Store cylinder.depth in XML files and in git storage. This info is in fact the gas switch depth of a specific gas/cylinder in the planner. This change avoids the need of typing in a user specific depth value again when replanning an existing planned dive. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-26Update list of divecomputers supported in Subsurface-mobileGravatar Dirk Hohndel
There was some whitespace change as well - this is straight from the tool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25In strings start lower case in parenthesisGravatar Stefan Fuchs
Start with lower case letter inside a parenthesis. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25In planner.c remove unused variable o2break_doneGravatar Stefan Fuchs
Reported-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-25Hand planner variables to profileGravatar Robert C. Helling
Pass the planner state struct to the profile computation so it can use deco_time and first ceiling to display VPM-B ceiling. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Localize global planner stateGravatar Robert C. Helling
For UI responsiveness, we need to be able to run the planner in the background. This needs the planner state to be localized (and we need to pass a pointer around). In order to not let too many lines overrun (and to save typing in the future) I have renamed instances of struct deco_state to ds. Yes this should have gone to a separate commit but I accidentally commit --amend'ed it. Computing of planner variations is temporarily disabled. Unlock the planner when returning early So we don't deadlock in add dive and recreational mode (which use the planner without actually planning). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Run variations calculation in backgroundGravatar Robert C. Helling
but there are still side effects and thus it crashes. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Add logic parentheses to make compiler happyGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-25Fix crash when dives have no dive siteGravatar Dirk Hohndel
get_dive_site_by_uuid() returns a NULL pointer in that case. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-11-25mobile: autocomplete location namesGravatar Jan Mulder
Add the capability to select the location name from a list, constructed from the known dive sites in the logbook. Fixes: #546 Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-11-25Fix ownership issues in preferences codeGravatar Berthold Stoeger
Each preferences object owns its string members. In three cases, pointers were copied instead of strings, leading to (in the best case) dangling pointers if the user edited values: 1) In the GET_TXT macro in core/prefs-macros.h 2) In the PreferencesDialog::defaultsRequested() method 3) In main() of the mobile version This patch fixes these issues, by using copy_string() or copy_prefs() as appropriate. The only reason that the old code didn't crash regularly is that the default_prefs object was only used at startup and defaultsRequested() is (at the moment?) dead code. This patch also aligns the backslashes in core/pref.h and fixes a typo. The declaration of copy_prefs() is moved to the core/prefs.h header. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-25Cleanup: remove unused extern declarationGravatar Berthold Stoeger
Removes the extern declaration of edit_dive, which wasn't defined anywhere. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-24Include stdbool.h also from prefs.h if included from C fileGravatar Stefan Fuchs
Currently not mandatory in our code because we never include prefs.h from a C file today but for the future this could avoid confusion. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-24Change prefs.show_units_table to boolGravatar Stefan Fuchs
Bool is the correct choice for this option. int was used before because it was not clear to me how and if I can use bool in this C file. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-11-22Clean up system_default_filename()Gravatar Berthold Stoeger
In the old implementation there were two static C-style strings, filename and path, which were initialized to NULL and filled on first call of the function (i.e. singletons). There is no sense in having two static variables indicating whether this function was called previously. Moreover, there is no point in remembering filename accross function calls, because it is not used once path is set to a non-NULL value. Therefore, make the filename variable non-static and calculate it only on first invocation (as indicated by a NULL path). Moreover, free() the filename variable after its use to fix a memory leak of the old code. The windows code is slightly different in that the temporary filename is not dynamically allocated. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-22Copy default filename string when assigning to default preferencesGravatar Berthold Stoeger
This tries to remove subtle ownership issues. When copying preferences structures, the default filename is copied. But the default preferences struct simply takes a pointer to a global string which is free()d in main(). Now, this is not strictly a bug because the free()ing of preferences resources is not implemented. Yet, let's try to make this consistent. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-20Make handling of booleans consistent on the C-side of preferencesGravatar Berthold Stoeger
Boolean settings were declared in pref.h randomly as bools and shorts. Since the code relied anyway on bool being well-defined and identical on the C- and C++-sides, turn all of them into bools. They use less space and express intent more clearly. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-20Make handling of booleans consistent on the C++-side of preferencesGravatar Berthold Stoeger
In general, the C++-side of the preferences code consistently uses the bool data type for boolean settings. There are five exceptions, which use short instead: showPo2 showPn2 showPhe saveUserIdLocal displayInvalidDives This patch attempts to make the code more consistent by turning these into bools as well. Tests showed that writing as short and reading as bool is handled gracefully by the Qt variant code. Therefore, an upgrade should not cause user-visible changes to their settings. As a bonus, two extern declarations of the set_save_userid_local() function, which is not defined anywhere, were removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-20Fix typo: successfull -> successful and succesfully -> successfullyGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>