From 6f8a48ab8d3c7dc3042a5e719d98000bd27de9ee Mon Sep 17 00:00:00 2001 From: Micke Prag Date: Wed, 23 Feb 2011 13:09:27 +0000 Subject: [PATCH] Display the reason for the error in a server assign request --- telldus-gui/Plugins/Live/LiveObject.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/telldus-gui/Plugins/Live/LiveObject.cpp b/telldus-gui/Plugins/Live/LiveObject.cpp index dc36ebb3..31dc0f6b 100644 --- a/telldus-gui/Plugins/Live/LiveObject.cpp +++ b/telldus-gui/Plugins/Live/LiveObject.cpp @@ -225,7 +225,12 @@ void LiveObject::sslErrors( const QList & errors ) { } void LiveObject::serverAssignReply( QNetworkReply *r ) { - qDebug() << "Server assign reply"; + r->deleteLater(); + if (r->error() != QNetworkReply::NoError) { + emit errorChanged(r->errorString()); + emit statusChanged("Error retrieving server list"); + return; + } QXmlStreamReader xml(r); xml.readNextStartElement(); // enter @@ -252,7 +257,6 @@ void LiveObject::serverAssignReply( QNetworkReply *r ) { emit statusChanged("Retrying in " + QString::number(timeout) + " seconds..."); QTimer::singleShot(timeout * 1000, this, SLOT(connectToServer())); } - r->deleteLater(); } QByteArray LiveObject::signatureForMessage( const QByteArray &message ) {