Changes: Changed the route table to a layout of buttons and tamed the layouts a bit.
[ptas] / zouba / src / gpscontroller.cpp
index abecb2d..32568b0 100644 (file)
@@ -1,8 +1,6 @@
 #include "gpscontroller.h"
 #include "gpscontroller_p.h"
 
-#include "locations.h"
-
 #include <QObject>
 #include <QGeoPositionInfo>
 #include <QGeoPositionInfoSource>
@@ -32,8 +30,7 @@ void GpsController::getGps()
   Location *location;
 
   if ( q->useFakeLocation() ) {
-    Locations *locations = Locations::instance();
-    location = locations->location( q->fakeLocationLabel() );
+    location = q->fakeLocation();
   } else {
     location = q->liveLocation();
   }
@@ -52,15 +49,14 @@ void GpsController::useFakeGps( const QString &fakeLocationLabel )
 {
   qDebug() << "using fake gps (" << fakeLocationLabel << ")";
 
-  Locations *locations = Locations::instance();
-  Location  *fakeLocation = locations->location( fakeLocationLabel );
+  q->setFakeLocationLabel( fakeLocationLabel );
+  Location  *fakeLocation = q->fakeLocation();
 
   if ( fakeLocation == 0 ) {
     qDebug() << "invalid fake location label; cannot use fake location";
   } else {
     q->stopGps();
     q->setUseFakeLocation( true );
-    q->setFakeLocationLabel( fakeLocationLabel );
     emit locationChanged( fakeLocation );
   }
 }