aboutsummaryrefslogtreecommitdiffstats
path: root/core/gpslocation.cpp
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-15 06:01:14 -0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-04-15 13:22:16 -0700
commit71d74f9e3c7cb49ab93aef035dbf7735b5ae3454 (patch)
tree668579dde6e2bec4e566ebc35892d1310c2fd40f /core/gpslocation.cpp
parentc111c4bb022229e66fb15cf8a7967bf79180a441 (diff)
downloadsubsurface-71d74f9e3c7cb49ab93aef035dbf7735b5ae3454.tar.gz
QML UI: rewrite the commitChanges function
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>
Diffstat (limited to 'core/gpslocation.cpp')
-rw-r--r--core/gpslocation.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/gpslocation.cpp b/core/gpslocation.cpp
index 8595cc45d..b56cb7b8c 100644
--- a/core/gpslocation.cpp
+++ b/core/gpslocation.cpp
@@ -111,7 +111,7 @@ QString GpsLocation::currentPosition()
// ok, we need to get the current position and somehow in the callback update the location in the QML UI
// punting right now
waitingForPosition = true;
- return QString("waiting for the next gps location");
+ return GPS_CURRENT_POS;
}
void GpsLocation::newPosition(QGeoPositionInfo pos)