1 #include "gpscontroller.h"
4 #include <QGeoPositionInfo>
5 #include <QGeoPositionInfoSource>
10 GpsController::GpsController() :
11 m_location( QGeoPositionInfoSource::createDefaultSource(this) ),
14 m_location->setUpdateInterval( 1*60*1000 );
17 m_location, SIGNAL( positionUpdated( QGeoPositionInfo ) ),
18 this, SLOT( updateLocation( QGeoPositionInfo ) )
21 m_location->startUpdates();
24 GpsController::~GpsController()
30 void GpsController::updateLocation( QGeoPositionInfo positionInfo )
32 Location newLocation( positionInfo );
34 if ( updatesEnabled ) {
35 emit locationChanged( newLocation );
36 updatesEnabled = false;
40 void GpsController::startGps()
42 updatesEnabled = true;