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 QXmlStreamReader xml( reply );
30 while ( !xml.atEnd() ) {
32 if ( xml.isStartElement() && xml.name() == "LOC" ) {
33 QXmlStreamAttributes attributes( xml.attributes() );
34 QStringRef xAttribute( attributes.value("x") );
35 QStringRef yAttribute( attributes.value("y") );
36 QString newX( xAttribute.toString() );
37 QString newY( yAttribute.toString() );
44 if ( xml.hasError() ) {
45 qDebug() << "xml error";
52 void LocationPrivate::setX( uint x )
54 m_x = QString( "%1" ).arg( x );
57 void LocationPrivate::setX( QString x )
62 QString LocationPrivate::x() const
67 void LocationPrivate::setY( uint y )
69 m_y = QString( "%1" ).arg( y );
72 void LocationPrivate::setY( QString y )
77 QString LocationPrivate::y() const
82 void LocationPrivate::setValid( bool valid )
87 bool LocationPrivate::isValid() const