2 #include "location_p.h"
4 #include <QXmlStreamReader>
8 LocationPrivate::LocationPrivate( QString x, QString y ) :
15 LocationPrivate::LocationPrivate() :
22 LocationPrivate::~LocationPrivate()
26 void LocationPrivate::parseReply( const QByteArray &reply )
28 qDebug() << "parsing";
29 QXmlStreamReader xml( reply );
31 while ( !xml.atEnd() ) {
33 if ( xml.isStartElement() && xml.name() == "LOC" ) {
34 QXmlStreamAttributes attributes( xml.attributes() );
35 QStringRef xAttribute( attributes.value("x") );
36 QStringRef yAttribute( attributes.value("y") );
37 QString newX( xAttribute.toString() );
38 QString newY( yAttribute.toString() );
45 if ( xml.hasError() ) {
46 qDebug() << "xml error";
49 qDebug() << "(" << m_x << "," << m_y << ")";
54 void LocationPrivate::setX( uint x )
56 m_x = QString( "%1" ).arg( x );
59 void LocationPrivate::setX( QString x )
64 QString LocationPrivate::x() const
69 void LocationPrivate::setY( uint y )
71 m_y = QString( "%1" ).arg( y );
74 void LocationPrivate::setY( QString y )
79 QString LocationPrivate::y() const
84 void LocationPrivate::setValid( bool valid )
89 bool LocationPrivate::isValid() const