2 #include "location_p.h"
4 #include <QXmlStreamReader>
8 LocationPrivate::LocationPrivate( const QString &x, const QString &y, const QString &label ) :
17 LocationPrivate::LocationPrivate( const QString &label ) :
26 LocationPrivate::~LocationPrivate()
30 void LocationPrivate::parseReply( const QByteArray &reply )
32 qDebug() << "parsing";
33 QXmlStreamReader xml( reply );
35 while ( !xml.atEnd() ) {
37 if ( xml.isStartElement() && xml.name() == "LOC" ) {
38 QXmlStreamAttributes attributes( xml.attributes() );
39 QStringRef xAttribute( attributes.value("x") );
40 QStringRef yAttribute( attributes.value("y") );
41 QString newX( xAttribute.toString() );
42 QString newY( yAttribute.toString() );
49 if ( xml.hasError() ) {
50 qDebug() << "xml error";
53 qDebug() << "(" << m_x << "," << m_y << ")";
58 void LocationPrivate::setLabel( const QString &label)
63 QString LocationPrivate::label() const
68 void LocationPrivate::setAddress( const QString &address)
73 QString LocationPrivate::address() const
78 void LocationPrivate::setX( uint x )
80 m_x = QString( "%1" ).arg( x );
83 void LocationPrivate::setX( const QString &x )
88 QString LocationPrivate::x() const
93 void LocationPrivate::setY( uint y )
95 m_y = QString( "%1" ).arg( y );
98 void LocationPrivate::setY( const QString &y )
103 QString LocationPrivate::y() const
108 void LocationPrivate::setValid( bool valid )
113 bool LocationPrivate::isValid() const