summaryrefslogtreecommitdiffstats
path: root/subsurface-core
AgeCommit message (Collapse)Author
2015-12-15Remove support for older libgit2 - we now require 0.23 or laterGravatar Dirk Hohndel
Also fixes a capitalization error that prevented finding libssh2 in some circumstances. And adds a missing include when building with libzip on Mac. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-08Dive model: use the correct time to set the time zone offsetGravatar Dirk Hohndel
We need to calculate the offset based on the time of the dive - the mobile version doesn't use displayed_dive. This way time stamps are now correct all year round. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-06Uemis downloader: handle yet another corner caseGravatar Dirk Hohndel
If we looking for dive details and are trying to guess the offset between object_id and logfilenr, we need to treat logfilenr 0 as special - it means we read past the end of the list of stored dives and need to walk backwards. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-06Only warn about different number of tanks and gases if there are tanksGravatar Dirk Hohndel
Some backends support giving tank data for some, but not all models that they support (and simply report no tanks for those models that don't support this). The Suunto Vyper is one of the dive computers where this happens and without this change we report angry red warnings after a perfectly correct download. So this changes the logic to only show that error if there actually were tanks reported. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03Cloud storage: do not store the actual pictures in gitGravatar Dirk Hohndel
Adding pictures to the repository was a big mistake on my part. It's very easy for the git repositories to reach a gigabyte and more making sync times (and especially "first download" times) completely unreasonable. This doesn't solve the problem for existing repositories (as the pictures are already there, in the git history), but at least it prevents us from storing more pictures out there. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03Crash fix in add_single_dive. No writing to dive_table.dives[-1]Gravatar K. \"pestophagous\" Heller
Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03Prevent gaschange tank icons from using garbage coords.Gravatar K. \"pestophagous\" Heller
Tank icons were shown at incorrect spots on the profile when the DiveEventItem object held a pointer to a struct event even after the struct event at that address had been freed. When internalEvent is a pointer to freed memory, internalEvent->time.seconds could have all kinds of crazy values, which get used in member function DiveEventItem::recalculatePos to place the tank at bad x coordinates. The DiveEventItem(s) no longer store a pointer to memory that they do not own. This way, no matter how the path of execution arrives into slot recalculatePos, we never need fear that the DiveEventItem will dereference a garbage pointer to a struct event. Fixes #968 Signed-off-by: K. Heller <pestophagous@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03Fix compile error on MacGravatar Dirk Hohndel
We need a space between the two string literals. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03Uemis downloader: ignore leading junk in the dataGravatar Dirk Hohndel
One user's debug log shows valid data, only not in the format we've seen before (with the response starting with '{'). Instead he gets a repeat of the second word in the response to processSync prepended to the expected output. So let's skip the data until the first '{'. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-03Uemis downloader: don't leak memoryGravatar Dirk Hohndel
Don't just clear out the buffer pointer, free the memory, first. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-02Add instance method for GpsLocationGravatar Dirk Hohndel
This way we can call members from different parts of the code. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-12-01Switch to compile time connect syntaxGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-30Subsurface-mobile: don't create the GPS source until it is neededGravatar Dirk Hohndel
This should accelerate the startup of the UI a little more. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-25Don't overwrite air temperatureGravatar Dirk Hohndel
If we already have an air temperature set, don't overwrite it with potentially less accurate infromation from the first sample. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Only close html tags if they were opened beforeGravatar Robert C. Helling
The runtime html table is printed only if printing a verbatim diveplan is disabled. So the closing tags should be printed only in that case. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-24Interpret - as STDOUT on writing xml filesGravatar Robert C. Helling
This prepares for the smartrack converter webservice. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18libdivecomputer.h: fix warning with DC_VERSION on Win32Gravatar Lubomir I. Ivanov
"warning: "DC_VERSION" redefined" is thrown if a chain of includes previously includes windows.h: In file included from c:/bin/mingw/i686-w64-mingw32/include/windows.h:71:0, from C:/bin/qt/5.5/mingw492_32/include/QtCore/qt_windows.h:63, from C:/bin/qt/5.5/mingw492_32/include/QtGui/qopengl.h:43, from C:/bin/qt/5.5/mingw492_32/include/QtQuick/qquickwindow.h:39, from C:/bin/qt/5.5/mingw492_32/include/QtQuick/QQuickWindow:1, from C:/dev/subsurface/subsurface-core/qt-gui.h:13, from C:\dev\subsurface\subsurface-mobile-main.cpp:9: and which on it's own includes wingdi.h which defines "DC_VERSION 10" (windows printer stack related). To solve the warning DC_VERSION is undefined in subsurface-core/libdivecomputer.h. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18applyLocations should be a void functionGravatar Dirk Hohndel
Another issue pointed out by Lubomir. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18gpslocation.cpp: fix signed vs unsinged int comparison warningGravatar Lubomir I. Ivanov
QDateTime::toTime_t() is misleading as it does not return a C time_t type, but a 'unsigned int' or rather the Qt 'uint' typedef. To prevent the warning we cast it to 'time_t' and to comply with the 'lastTime' variable. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: when applying GPS locations mark divelist changedGravatar Dirk Hohndel
Lubomir pointed out that this variable was unused. Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: check presence of location sourceGravatar Dirk Hohndel
In theory this should only report a location service if this is a satellite based service, but sadly geoclue appears to claim that there is a satellite based service in my Linux VM - so I'm doubtful that this does what the documentation says it does. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: instantiate location provider in the desktop UIGravatar Dirk Hohndel
We still aren't doing anything with it, but at least it's there now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: move into subsurface-coreGravatar Dirk Hohndel
While this is primarily something targeted at a mobile device, with many of the 2 in 1 devices it is possible that the user might be running the desktop version of Subsurface on a mobile device. As a first step to make it possible to collect GPS fixes on such a device we need to make the infrastructure to do so available in the desktop application as well. This still needs to be hooked up in the desktop UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Cloud storage: modify protocol for checking cloud connectivityGravatar Dirk Hohndel
In order to allow the backend to match account in multi user mode, it needs to know if the requests are coming from the same instance of Subsurface. Since I had to change the backend to add the ability to retrieve a location service userid I added this capability at the same time. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-18Location service: set user agent stringGravatar Dirk Hohndel
This allows the backend to know which version of Subsurface is contacting it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper.cpp: improve getFormattedCylinder()Gravatar Lubomir I. Ivanov
When the user requests "dive.cylinders" from Grantlee HTML we need to always put at least the default cylinder and mark the description as "unknown" (same as other locations) if it's not set (i.e. when the description pointer is NULL). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper: also support "maxcns" and "otu" in Grantlee HTMLGravatar Lubomir I. Ivanov
Fixes #962 Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper: add means to retreive weight and cylinder info in DiveGravatar Lubomir I. Ivanov
The Dive helper class only picks the first cylinder and the total weight. This patch adds the option to dump the cylinders and weights as formatted lists (via cylinders() and weights()) or to retrieve a specific cylinder or weight via (cylinder(index) and weight(index)). Each cylinder and weight string contains detailed information: cylinder: - desc. - pressure (+start/end) - gasmix - etc... weight: - desc. - weight (in units e.g. kg) If no description is found for a cylinder or weight the contents for this particular unit is filled with EMPTY_DIVE_STRING ("--"). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16qthelper.cpp: define EMPTY_DIVE_STRINGGravatar Lubomir I. Ivanov
The macro is used as a common replacer for the "--" string when the Dive class members return no particular information for a "struct dive" property. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16CMakeLists: use correct 'desktop-widgets' pathGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-16dive.c: fix a couple of comment typosGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15qthelper.cpp: support line breaks for notes when printingGravatar Lubomir I. Ivanov
The Dive::put_notes() does not handle HTML formatting or line breaks properly. Apparently Grantlee supports HTML variables, but the planned notes (which are HTML) look very bad when inserted in the Grantlee template - e.g. the text is huge and the table box is cut for some odd reason. I don't have a good solution for these issues ATM; especially for the "table cell being cut part". An important feature in the dive notes is to support line breaks. This patch adds support for line breaks both in planned dive notes and non-planned dive notes via the <br> tag. This makes the planned dive notes look tolerable. The next step would be to support the <br> tag, which has to happen in the bundled templates them self. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15simple spelling changesGravatar Stephen Hemminger
Fix obvious spelling mistakes in comments (and one error message). Yes, this is trivial but I saw one while reviewing some of the code and after that decided to run code through some tools. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15subsurfacestartup.c: leave free_prefs() emptyGravatar Lubomir I. Ivanov
There is a bug on OSX where free() is called on non-allocated memory in free_prefs(). Most of the preferences are not freed in free_prefs() while copy_string() is used on them, so let's not free() any pointers in free_prefs() and leave them as one-time leaks. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-15planner.c: fix 'disclaimer' pointing to stack memoryGravatar Lubomir I. Ivanov
In add_plan_to_notes() the 'disclaimer' is set to the temporary buffer 'buf'. By making 'buf' static, 'disclaimer' now points to a persistent buffer. Bug was reported as bad characters when printing the planner deco text. Reported-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14Missing half of the previous commitGravatar Dirk Hohndel
Oops. I fixed the previous commit, tested the fix, and then forgot to update the commit and instead pushed it out. That was dumb. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14Move proxy initialization into shared codeGravatar Dirk Hohndel
This way we can use the same code on desktop and mobile app. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-14Location service: make distance and time threshold configurableGravatar Dirk Hohndel
Right now the distance is always in meters, the mobile app doesn't deal with units at all, anyway. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Remove empty implementationsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Removed unused filesGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Remove the PluginSystemGravatar Tomaz Canabrava
But keep the Interface so it's still userfull to create a new SocialNetwork when needed, but it will be part of the code, and not a plugin. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Uemis downloader: more debug outputGravatar Dirk Hohndel
Once again compile time enabled. I guess it would be nice to turn this into a logfile (just like we have with the libdivecomputer backends). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Uemis downloader: recover if dive info is completely missingGravatar Dirk Hohndel
I user had a Uemis that had a dive log entry for a certain internal id but no dive info for it. This appeared to be one of those dreaded dives when the Uemis decides to start a dive at the end of a flight and then stays in dive mode until it runs out of battery. Anyway, if we see a number above and a number below, just give up and move on. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Uemis downloader: deal with a whole block of deleted divesGravatar Dirk Hohndel
If every dive in a download block from the Uemis was deleted we kept downloading that same block of dives. With this we remember how far we got even if the dives ended up being deleted. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-09Store Thumbnails with image hashesGravatar Robert C. Helling
This drastically improves the time it takes to select a dive with several pictures at the expense of longer startup and bigger hash files. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Removed C++11 from the code.Gravatar Tomaz Canabrava
Make Dirk ungrumpy Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Uemis downloader: print some information on stderr in verbose modeGravatar Dirk Hohndel
On the Mac the info on the download dialog isn't shown. So print it on stderr as well when in verbose mode. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Change from uploadCurrentDive to requestUpload callGravatar Tomaz Canabrava
Since we can't forbit the plugins to upload more than just the current dive, it's better to change the name of the call. also add a stub to make sure it's calling the right method inside the plugin. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-08Make it possible to connect to facebook againGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07dive.c: remove unused variableGravatar Lubomir I. Ivanov
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>