From: Max Waterman Date: Sun, 25 Apr 2010 03:09:50 +0000 (+0300) Subject: Changes: added notification for address resolution failure and no route; fixed issue... X-Git-Url: https://vcs.maemo.org/git/?a=commitdiff_plain;h=fd76ea65d57470e8069666d9a38525f502cc5897;hp=1f88ace8f69a25bb34a97d8a8765099ffcf320d5;p=ptas Changes: added notification for address resolution failure and no route; fixed issue with multiple route requests for a single button click. version 0.9 --- diff --git a/zouba/debian/changelog b/zouba/debian/changelog index 8249ab2..a37b5e8 100644 --- a/zouba/debian/changelog +++ b/zouba/debian/changelog @@ -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 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. diff --git a/zouba/src/gpscontroller.cpp b/zouba/src/gpscontroller.cpp index 32568b0..d924564 100644 --- a/zouba/src/gpscontroller.cpp +++ b/zouba/src/gpscontroller.cpp @@ -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() diff --git a/zouba/src/gpscontroller_p.cpp b/zouba/src/gpscontroller_p.cpp index 537d10a..831aacf 100644 --- a/zouba/src/gpscontroller_p.cpp +++ b/zouba/src/gpscontroller_p.cpp @@ -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; +} diff --git a/zouba/src/gpscontroller_p.h b/zouba/src/gpscontroller_p.h index 46bd6c9..a101ffe 100644 --- a/zouba/src/gpscontroller_p.h +++ b/zouba/src/gpscontroller_p.h @@ -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 diff --git a/zouba/src/location_p.cpp b/zouba/src/location_p.cpp index 442977b..fe9d555 100644 --- a/zouba/src/location_p.cpp +++ b/zouba/src/location_p.cpp @@ -4,6 +4,7 @@ #include #include #include +#include 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 { diff --git a/zouba/src/route_p.cpp b/zouba/src/route_p.cpp index 18380f7..d2125da 100644 --- a/zouba/src/route_p.cpp +++ b/zouba/src/route_p.cpp @@ -6,6 +6,7 @@ #include #include #include +#include RoutePrivate::RoutePrivate( QObject *parent ) : m_fromValid(false), @@ -169,6 +170,7 @@ QList RoutePrivate::parseReply( const QByteArray &reply ) if ( retVal.isEmpty() ) { qDebug() << "no routes found"; + QMaemo5InformationBox::information( 0, "no routes found" ); } return retVal; diff --git a/zouba/src/uicontroller.cpp b/zouba/src/uicontroller.cpp index 962135f..333a1d8 100644 --- a/zouba/src/uicontroller.cpp +++ b/zouba/src/uicontroller.cpp @@ -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(); } diff --git a/zouba/zouba.pro b/zouba/zouba.pro index 845d0ff..d978a4c 100644 --- a/zouba/zouba.pro +++ b/zouba/zouba.pro @@ -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/