Changes: added notification for address resolution failure and no route; fixed issue...
authorMax Waterman <david.waterman@nokia.com>
Sun, 25 Apr 2010 03:09:50 +0000 (06:09 +0300)
committerMax Waterman <david.waterman@nokia.com>
Sun, 25 Apr 2010 03:13:06 +0000 (06:13 +0300)
zouba/debian/changelog
zouba/src/gpscontroller.cpp
zouba/src/gpscontroller_p.cpp
zouba/src/gpscontroller_p.h
zouba/src/location_p.cpp
zouba/src/route_p.cpp
zouba/src/uicontroller.cpp
zouba/zouba.pro

index 8249ab2..a37b5e8 100644 (file)
@@ -1,3 +1,10 @@
+zouba (0.9) unstable; urgency=low
+
+  * added notification for address resolution failure and no route
+  * fixed issue with multiple route requests for a single button click 
+
+ -- Max Waterman <davidmaxwaterman@fastmail.co.uk>  Sun, 25 Apr 2010 06:12:00 +0200
+
 zouba (0.8) unstable; urgency=low
 
   * Fixed problem when changing the address of a location to something invalid.
index 32568b0..d924564 100644 (file)
@@ -28,6 +28,7 @@ GpsController::~GpsController()
 void GpsController::getGps()
 {
   Location *location;
+  Location *previousLocation = q->mostRecentlyReportedLocation();
 
   if ( q->useFakeLocation() ) {
     location = q->fakeLocation();
@@ -35,7 +36,9 @@ void GpsController::getGps()
     location = q->liveLocation();
   }
 
-  emit locationChanged( location );
+  if ( location != previousLocation ) {
+    emit locationChanged( location );
+  }
 }
 
 void GpsController::useLiveGps()
index 537d10a..831aacf 100644 (file)
@@ -57,6 +57,7 @@ void GpsControllerPrivate::setGps( QGeoPositionInfoSource *gps )
 
 Location *GpsControllerPrivate::liveLocation()
 {
+  m_mostRecentlyReportedLocation = m_liveLocation;
   return m_liveLocation;
 }
 
@@ -64,6 +65,7 @@ Location *GpsControllerPrivate::fakeLocation()
 {
   Locations *locations = Locations::instance();
   Location  *location = locations->location( fakeLocationLabel() );
+  m_mostRecentlyReportedLocation = location;
   return location;
 }
 
@@ -92,3 +94,7 @@ void GpsControllerPrivate::updateLocation( QGeoPositionInfo positionInfo )
   m_liveLocation->setLocation( positionInfo );
 }
 
+Location *GpsControllerPrivate::mostRecentlyReportedLocation()
+{
+  return m_mostRecentlyReportedLocation;
+}
index 46bd6c9..a101ffe 100644 (file)
@@ -27,6 +27,7 @@ public:
     virtual QGeoPositionInfoSource *gps();
     virtual Location               *liveLocation();
     virtual Location               *fakeLocation();
+    virtual Location               *mostRecentlyReportedLocation();
     virtual QString                 fakeLocationLabel();
     virtual bool                    useFakeLocation();
 
@@ -38,6 +39,7 @@ private:
     Location               *m_liveLocation;
     QString                 m_fakeLocationLabel;
     bool                    m_useFakeLocation;
+    Location               *m_mostRecentlyReportedLocation;
 };
 
 #endif //GPSCONTROLLER_P_H
index 442977b..fe9d555 100644 (file)
@@ -4,6 +4,7 @@
 #include <QXmlStreamReader>
 #include <QByteArray>
 #include <QDebug>
+#include <QMaemo5InformationBox>
 
 LocationPrivate::LocationPrivate( const QString &x, const QString &y, const QString &label ) :
   m_label(label),
@@ -63,6 +64,7 @@ void LocationPrivate::parseReply( const QByteArray &reply )
   }
 
   if ( xml.hasError() || responseHasError ) {
+    QMaemo5InformationBox::information( 0, "address resolution error - please check address" );
     qDebug() << "xml error";
     m_valid = false;
   } else {
index 18380f7..d2125da 100644 (file)
@@ -6,6 +6,7 @@
 #include <QList>
 #include <QFile>
 #include <QStringList>
+#include <QMaemo5InformationBox>
 
 RoutePrivate::RoutePrivate( QObject *parent ) :
     m_fromValid(false),
@@ -169,6 +170,7 @@ QList<RouteData> RoutePrivate::parseReply( const QByteArray &reply )
 
   if ( retVal.isEmpty() ) {
     qDebug() << "no routes found";
+    QMaemo5InformationBox::information( 0, "no routes found" );
   }
 
   return retVal;
index 962135f..333a1d8 100644 (file)
@@ -126,9 +126,10 @@ void UiController::changeDestination( int id )
   if ( destinationHasChanged ) {
     qDebug() << "Emitting destination changed (" << m_destination[id]->label() << ")";
     emit destinationChanged( m_destination[id] );
+    m_currentDestination = id;
   }
 
-  // always want to emit this so that the gps position is update
+  // always want to emit this so that the gps position is updated
   // and the user gets new information
   emit buttonClicked();
 }
index 845d0ff..d978a4c 100644 (file)
@@ -46,7 +46,7 @@ VPATH       += src uis
 CONFIG      -=
 CONFIG      += debug qt mobility
 MOBILITY    += location bearer
-QT=core gui network
+QT=core gui network maemo5
 
 INSTALLS    += target
 target.path  = /usr/bin/