projects
/
ptas
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Changed package description to indicate Helsinki only
[ptas]
/
zouba
/
src
/
gpscontroller_p.cpp
diff --git
a/zouba/src/gpscontroller_p.cpp
b/zouba/src/gpscontroller_p.cpp
index
6c6951e
..
c654146
100644
(file)
--- a/
zouba/src/gpscontroller_p.cpp
+++ b/
zouba/src/gpscontroller_p.cpp
@@
-60,7
+60,10
@@
Location *GpsControllerPrivate::currentLocation()
void GpsControllerPrivate::setCurrentLocation( Location *location )
{
void GpsControllerPrivate::setCurrentLocation( Location *location )
{
- delete m_currentLocation;
+ if ( m_currentLocation && m_currentLocation->label() == "livegps" ) {
+ delete m_currentLocation;
+ m_currentLocation=0;
+ }
m_currentLocation = location;
}
m_currentLocation = location;
}
@@
-71,14
+74,19
@@
bool GpsControllerPrivate::useFakeLocation()
void GpsControllerPrivate::setUseFakeLocation( bool useFake )
{
void GpsControllerPrivate::setUseFakeLocation( bool useFake )
{
+ // delete previous GPS if it was live and we're switching to fake
+ if ( m_currentLocation && m_currentLocation->label() == "livegps" ) {
+ delete m_currentLocation;
+ m_currentLocation = 0;
+ }
m_useFakeLocation = useFake;
}
void GpsControllerPrivate::updateLocation( QGeoPositionInfo positionInfo )
{
m_useFakeLocation = useFake;
}
void GpsControllerPrivate::updateLocation( QGeoPositionInfo positionInfo )
{
- if ( !m_useFakeLocation ) {
+ if ( m_currentLocation && m_currentLocation->label() == "livegps" ) {
delete m_currentLocation;
delete m_currentLocation;
- m_currentLocation = new Location( positionInfo );
}
}
+ m_currentLocation = new Location( positionInfo, "livegps" );
}
}