1 #include "gpscontroller.h"
4 #include <QGeoPositionInfo>
5 #include <QGeoPositionInfoSource>
10 GpsController::GpsController() :
11 m_location( QGeoPositionInfoSource::createDefaultSource(this) ),
15 m_location, SIGNAL( positionUpdated( QGeoPositionInfo ) ),
16 this, SLOT( updateLocation( QGeoPositionInfo ) )
19 m_location->startUpdates();
22 GpsController::~GpsController()
26 delete currentLocation;
30 void GpsController::updateLocation( QGeoPositionInfo positionInfo )
32 delete currentLocation;
33 currentLocation = new Location( positionInfo );
36 void GpsController::getGps()
38 if ( currentLocation != 0 ) {
39 emit locationChanged( currentLocation );