+zouba (0.8) unstable; urgency=low
+
+ * Fixed problem when changing the address of a location to something invalid.
+
+ -- Max Waterman <davidmaxwaterman@fastmail.co.uk> Sat, 24 Apr 2010 03:39:00 +0200
+
zouba (0.7) unstable; urgency=low
* Changed gps controller to use labels for fake gps instead of a new Location instance.
* Added route detail table and general associated shuffle of api.
- -- Max Waterman <davidmaxwaterman@fastmail.co.uk> Mon, 20 Apr 2010 06:27:00 +0200
+ -- Max Waterman <davidmaxwaterman@fastmail.co.uk> Tue, 20 Apr 2010 06:27:00 +0200
zouba (0.6) unstable; urgency=low
{
qDebug() << "parsing";
QXmlStreamReader xml( reply );
+ bool responseHasError = false;
while ( !xml.atEnd() ) {
xml.readNext();
- if ( xml.isStartElement() && xml.name() == "LOC" ) {
- QXmlStreamAttributes attributes( xml.attributes() );
- QStringRef xAttribute( attributes.value("x") );
- QStringRef yAttribute( attributes.value("y") );
- QString newX( xAttribute.toString() );
- QString newY( yAttribute.toString() );
-
- m_x = newX;
- m_y = newY;
+
+ if ( xml.isStartElement() ) {
+ QString xmlName( xml.name().toString() );
+
+ if ( xmlName == "LOC" ) {
+ QXmlStreamAttributes attributes( xml.attributes() );
+ QStringRef xAttribute( attributes.value("x") );
+ QStringRef yAttribute( attributes.value("y") );
+ QString newX( xAttribute.toString() );
+ QString newY( yAttribute.toString() );
+
+ m_x = newX;
+ m_y = newY;
+ }
+
+ if ( xmlName == "ERROR" ) {
+ responseHasError = true;
+ }
+
}
}
- if ( xml.hasError() ) {
+ if ( xml.hasError() || responseHasError ) {
qDebug() << "xml error";
m_valid = false;
} else {
this, SLOT( setHomeButtonValid() )
);
connect(
+ homeLocation, SIGNAL( becomeInValid() ),
+ this, SLOT( setHomeButtonInValid() )
+ );
+ connect(
homeLocation, SIGNAL( becomeValid() ),
locations, SLOT( saveLocation() )
);
+ connect(
+ homeLocation, SIGNAL( busy( bool ) ),
+ ui, SLOT( setBusy( bool ) )
+ );
connect(
workLocation, SIGNAL( becomeValid() ),
this, SLOT( setWorkButtonValid() )
);
connect(
+ workLocation, SIGNAL( becomeInValid() ),
+ this, SLOT( setWorkButtonInValid() )
+ );
+ connect(
workLocation, SIGNAL( becomeValid() ),
locations, SLOT( saveLocation() )
);
+ connect(
+ workLocation, SIGNAL( busy( bool ) ),
+ ui, SLOT( setBusy( bool ) )
+ );
m_destination.append( homeLocation );
m_destination.append( workLocation );
{
}
+void UiController::setHomeButtonInValid()
+{
+ qDebug() << "setting home button invalid";
+ setButtonValid( Ui::HomeButtonId, false );
+}
+
void UiController::setHomeButtonValid()
{
qDebug() << "setting home button valid";
- setButtonValid( Ui::HomeButtonId );
+ setButtonValid( Ui::HomeButtonId, true );
+}
+
+void UiController::setWorkButtonInValid()
+{
+ qDebug() << "setting work button invalid";
+ setButtonValid( Ui::WorkButtonId, false );
}
void UiController::setWorkButtonValid()
{
qDebug() << "setting work button valid";
- setButtonValid( Ui::WorkButtonId );
+ setButtonValid( Ui::WorkButtonId, true );
}
-void UiController::setButtonValid( int id )
+void UiController::setButtonValid( int id, bool isValid )
{
- m_ui->m_destinationButtons->button( id )->setEnabled(true);
+ m_ui->m_destinationButtons->button( id )->setEnabled( isValid );
}
void UiController::changeDestination( int id )
void changeRoute( int id );
void setHomeButtonValid();
void setWorkButtonValid();
+ void setHomeButtonInValid();
+ void setWorkButtonInValid();
void displayRouteDetail( int id );
private:
- void setButtonValid( int id );
+ void setButtonValid( int id, bool isValid );
private:
QList<RouteData> m_routeData;