1 #include "gpscontroller_p.h"
6 #include <QGeoPositionInfo>
7 #include <QGeoPositionInfoSource>
12 GpsControllerPrivate::GpsControllerPrivate() :
14 m_liveLocation( new Location( "livegps" ) ),
15 m_fakeLocationLabel(),
16 m_useFakeLocation(false)
20 GpsControllerPrivate::~GpsControllerPrivate()
24 delete m_liveLocation;
28 void GpsControllerPrivate::init()
30 m_gps = QGeoPositionInfoSource::createDefaultSource(this);
32 m_gps, SIGNAL( positionUpdated( QGeoPositionInfo ) ),
33 this, SLOT( updateLocation( QGeoPositionInfo ) )
37 void GpsControllerPrivate::startGps()
39 m_gps->startUpdates();
42 void GpsControllerPrivate::stopGps()
47 QGeoPositionInfoSource *GpsControllerPrivate::gps()
52 void GpsControllerPrivate::setGps( QGeoPositionInfoSource *gps )
57 Location *GpsControllerPrivate::liveLocation()
59 return m_liveLocation;
62 QString GpsControllerPrivate::fakeLocationLabel()
64 return m_fakeLocationLabel;
67 void GpsControllerPrivate::setFakeLocationLabel( const QString &label )
69 m_fakeLocationLabel = label;
72 bool GpsControllerPrivate::useFakeLocation()
74 return m_useFakeLocation;
77 void GpsControllerPrivate::setUseFakeLocation( bool useFake )
79 m_useFakeLocation = useFake;
82 void GpsControllerPrivate::updateLocation( QGeoPositionInfo positionInfo )
84 m_liveLocation->setLocation( positionInfo );