aboutsummaryrefslogtreecommitdiffstats
path: root/subsurface-core
AgeCommit message (Collapse)Author
2016-03-26Prevent unintentionally running as rootGravatar Robert C. Helling
Some users try to run Subsurface as root for example to get around permission problems with dive computer devices. This is a bad idea since config files get touched as root and then cannot be read as normal user anymore. This patch allows running as root only with verbose option on. We can assume if somebody manages to start subsurface as root this happens from the command line. For some reason, I couldn't get translation working at this stage. Windows version is a stub. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24QML UI: add the position source reported to the logGravatar Dirk Hohndel
I've seen iPads without GPS report that they support satellite positioning. Seems like a Qt bug to me. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24QML UI: GPS location service - correctly calculate the deltaGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24QML UI: GPS location service - only show the fixes we storeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24Read GPS location service thresholds from settingsGravatar Dirk Hohndel
We used to faithfully save them, but not restore them at start. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-24Give more information about the GPS location serviceGravatar Dirk Hohndel
On iOS it seems that I get a fix every second. Even though the QGeoPositionInfoSource is set up with an update interval of 5 minutes... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Another small signed / unsigned warning fixGravatar Dirk Hohndel
This is in the Mac support file that wasn't compiled on Linux when I tried to finish the cleanup. Now this compiles without warnings on Mac and iOS as well. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Make code easier to read (and avoid warning)Gravatar Dirk Hohndel
The old expression wass correct because if dive_table.dives[j]->number is != 0, then !dive_table.dives[j]->number is 0 and vice versa. But come on... The new code seems much more natural and easier to read. And of course the Apple compilers by default gave a warning because they suspected a precedence bug with the old code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Compare with the right git sha when deciding nothing has changedGravatar Dirk Hohndel
The saved_git_id could be updated in is_git_repository() under certain circumstances, so we need to make sure we compare to the sha that was current as we entered this function. Since the pointer is just to a static buffer we need to actually copy it (and then free it later). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23When clearing dive file data, forget the saved git shaGravatar Dirk Hohndel
Otherwise parse_file() thinks that this data has already been loaded and doesn't re-read it, even though our internal data structures have been erased - so a subsequent parse_file after clear_dive_file_data() that opens the same git repository finishes successfully, but leaves the dive_table empty which is of course incorrect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Another attempt to clean up signed / unsigned in profile.cGravatar Dirk Hohndel
This time we err on the side of signed variables most of the time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Don't try to force depth to be unsignedGravatar Dirk Hohndel
Trying to clean up the signed vs. unsigned issues it becomes clear that forcing depth to be unsigned causes way too many problems in the code. So this commit goes the opposite direction; since we clearly aren't limited INT_MAX vs UINT_MAX, simply make more of the depth related variables signed. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Revert "Clean up signedness confusion in planner.c"Gravatar Dirk Hohndel
This reverts commit 59299f0ab34ca4d75e0b02d9a83f23ec6348e1df. Doing this oversimplified "fix" actually breaks the planner. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-19Planner: add segment symbol to output tableGravatar Rick Walsh
Add a symbol to each line of output table indicating whether a segment is an ascent, descent, constant depth (user entered) or deco stop Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Robert C. Helling <helling@atdotde.de>
2016-03-16Fix loading images from URLsGravatar Robert C. Helling
This was broken when introducing loading images from the server. Now it first tries the server and if that fails tries the actual URL. Still, the image does not show up immediately, since the DivePictureModel is unavailable to the image downloader to be told to update the images. This needs to be fixed but in the mean time, the image is shown when the dive is reselected (possibly on the next run) since it is then loaded from the cache. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-16When handing off a picture to a worker thread, copy it firstGravatar Robert C. Helling
as otherwise we crash when the picture is freed before the worker thread (to load from the net or to compute hashes) is finished Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13Use more informative error message in application logGravatar Dirk Hohndel
While on the desktop we show the error to the user, in Subsurface-mobile it's only appended to the log; so in order to improve debuggability it makes sense to show the full error there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13gas model: update to new coefficients, and simplify expressionsGravatar Linus Torvalds
This updates the gas model to use the new virial coefficients from the R script, and simplifies the expression a tiny bit by avoiding the division by 1000 for the gas fractions, and replacing it with a multiply by 0.001 at the end. The virial coefficients for Oxygen and Nitrogen changed in the last digits due to the use of a different tool for the least-square fitting. That also accounts for the change in format (the coefficients are not using scientific notation). The coefficients for Helium changed noticeably more, since they are now based on the new least-squares fit from the raw data. But the actual end result does not change appreciably, the main advantage is that now the numbers are easily reproducible. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13gas model: add proper He compressibility data and do a least-squares fitGravatar Linus Torvalds
Lubomir pointed to exactly where he got his data from, so I added that raw Helium data to the R script, and let the least-squares fit just take care of the interpolation between 273K and 323K. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-13gas-model: add R compressibility scriptGravatar Linus Torvalds
It annoyed me that we hand-waved a bit about how the virial factors were actually computed in the gas-model.c file, so here's an actual R script that computes them and plots the results. You can run it with (for example): R --vanilla < compressibility.r and it will generate a Rplots.pdf of the plots, and the coefficients will be shown on stdout. The result actually differs in insignificant ways from the values that Lubomir computed, which is likely just due to tools. I used R, Lubomir seems to have used http://polynomialregression.drque.net/online.php but the actual curve is pretty much the same. NOTE! R is not entirely happy about the non-linear fit of the Helium curve: the fit is *so* precise that it failes the R relative-offset convergence criterion. That is apparently generally a sign of artificial data. That is probably because Lubomir generated them from the linear mix of two polynomial fits, rather than a linear mix of the original data. But maybe the original data was artificial? Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-10Revert "Clean up signedness confusion in gaspressures.h"Gravatar Dirk Hohndel
This reverts commit 7d1c2a142fcae4e4085a9f04d0c7a02d4089b6c7. Another one.
2016-03-10Revert "Clean up signedness confusion in profile.c"Gravatar Dirk Hohndel
This reverts commit 7f2ad93396091edd58b4e0930b5e62d2f6a066c7. Idiot maintainer to do cleanup like this right before a release
2016-03-09Silence warnings in linux.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in qtserialbluetooth.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up UEMIS downloaderGravatar Dirk Hohndel
Mostly signedness issues, but also removing useless code that didn't have any effect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in time.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Remove unused functionGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in statistics.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in gaspressures.hGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in profile.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in planner.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in parse-xml.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in libdivecomputer.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warning in file.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in divelist.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Clean up signedness confusion in dive.cGravatar Dirk Hohndel
This started out as cleaning up warnings - but it actually turned into a matter of semantics and correctness. Which lead to changes in .h files which will have a ton of ripple effects. A lot more of this to come. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in cochran.cGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in worldmap-save.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in save-xml.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in save-html.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in save-git.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in parse-xml.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in membuffer.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in load-git.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in libdivecomputer.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in git-access.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in gaspressures.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in equipment.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in datatrack.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in cochram.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>