aboutsummaryrefslogtreecommitdiffstats
path: root/core/gpslocation.h
AgeCommit message (Collapse)Author
2018-10-21Add 'location_t' data structureGravatar Linus Torvalds
Instead of having people treat latitude and longitude as separate things, just add a 'location_t' data structure that contains both. Almost all cases want to always act on them together. This is really just prep-work for adding a few more locations that we track: I want to add a entry/exit location to each dive (independent of the dive site) because of how the Garmin Descent gives us the information (and hopefully, some day, other dive computers too). Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-09-24core: fix connect callGravatar Jan Mulder
Fix multiple run-time errors in connect call introduced in 504e9125126. 1) Set the proper signature of the signal. 2) make the used slot a real slot (so move it to the proper section in the header) and 3) set the proper signature for the slot. Highly unlikely that normal users notice the runtime errors and possibly unwantend behavior, as this all deals with the subtile GPS service update threshold. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-09-11cleanup[4/6], mobile: remove superfluous code from gpslocationGravatar Jan Mulder
Despite the fast that this code is sitting in core, its used mainly from mobile. In 987e221f8e6b7b, the buttons to interact with the GPS webservice were deleted from the UI. Now, delete all the code that was used under these buttons. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2018-07-04Translations: unify gettextFromC::tr() and QObject::tr()Gravatar Berthold Stoeger
There were two catch-all classes for translations outside of class context. gettextFromC was used exclusively from C, but C++ used both, gettextFromC and QObject. Some of the string were even present in both. Therefore, unify to gettextFromC throughout the code base. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-04-14GPS: add signal to show that a new fix has been acquiredGravatar Dirk Hohndel
This way if we don't have a current enough position we can wait for a current fix to be acquired. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-01-10GpsLocation::clearGpsData() is only used in SUBSURFACE_MOBILEGravatar Jan Mulder
Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-07-25Mobile: honour location service time thresholdGravatar Jan Mulder
Independ of the settings, the threshold to reset the GPS data was hard coded to 5 minutes. Now, honour the entered (and updated during a session) time to refresh the GPS data in the location service. Signed-off-by: Jan Mulder <jlmulder@xs4all.nl>
2017-05-06Check if we have an instance before dereferencing itGravatar Dirk Hohndel
If we don't have a GPS service userid in the preferences and the GpsLocation class isn't instantiated, this would cause a crash. Fixes #367 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-04-29Add SPDX header to remaining core filesGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17GPS provider: change haveGPS status if GPS source returns errorGravatar Dirk Hohndel
If the GPS source returns an error that could be an indication that the user hasn't given us permission to use it, so switch our status to NOGPS. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-17GPS provider: track tristate information for GPS sourceGravatar Dirk Hohndel
Initially we don't know if we have a source. After that we may think that we have one, or not have one (but that can actually change while the program is running if the user, for example, turns the source off or switches to airplane mode). Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-15QML UI: rewrite the commitChanges functionGravatar Dirk Hohndel
I couldn't figure out how to break this down into small, useful commits. Part of the problem is that I kept going while working on this and as you can see from looking at the commit, diff tries so hard to find small code fragments that moved around, that the diff overall becomes quite unreadable and it seemed impossible to recreate the sequence of steps after the fact. It all started with adding the parsing for the GPS coordinates. But while testing that code I found several issues with the rest of the function. Most importantly it seemed ridiculous that we carefully tried to match the texts that the DiveObjectHelper would create for the various fields, instead of just using the DiveObjectHelper to do just that. And once I had converted that I once again realized just how long and hard to understand that function was getting and decided to break out some of the more complex parts into their own helper functions. But of course all this didn't happen in this logical, structured, ordered way. Instead I did all of these things at the same time, testing, rearranging, etc. So in the end I went with one BIG commit that does all of this in one fell swoop. This adds four helper functions to deal with start time/date, duration, location and gps coordinates, and depth of the dive. To avoid mistakes when dealing with the GPS coordinates, there's another helper to encapsulate the creation of the dive site and we switched to a current GPS location. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-04Move subsurface-core to core and qt-mobile to mobile-widgetsGravatar Dirk Hohndel
Having subsurface-core as a directory name really messes with autocomplete and is obviously redundant. Simmilarly, qt-mobile caused an autocomplete conflict and also was inconsistent with the desktop-widget name for the directory containing the "other" UI. And while cleaning up the resulting change in the path name for include files, I decided to clean up those even more to make them consistent overall. This could have been handled in more commits, but since this requires a make clean before the build, it seemed more sensible to do it all in one. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>