--- infoscreen/pictureview.cpp 2010/01/05 17:19:02 526 +++ infoscreen/pictureview.cpp 2010/01/06 22:18:52 528 @@ -1,15 +1,13 @@ #include "pictureview.h" -#include -#include -#include -#include -#include +#include + + +#include "httpwrapper.h" PictureView::PictureView(QWidget* parent) : QWidget(parent) { - http.connect(&http, SIGNAL(requestFinished(int,bool)),this, SLOT(onLoad(int,bool)) ); } void PictureView::paintEvent ( QPaintEvent* event) @@ -27,23 +25,7 @@ image = it.value(); this->repaint(); } else { - requestedUrl = source; - - QUrl url(requestedUrl); - http.setHost(url.host() ); - http.get(url.path(), 0); - } -} - -void PictureView::onLoad(int id, bool ok) -{ - Q_UNUSED(id); - Q_UNUSED(ok); - qint64 byteCount = http.bytesAvailable(); - - if (byteCount > 0) { - - QByteArray data = http.readAll(); + QByteArray data = HttpWrapper::getSyncData(source); QPixmap pixmap; pixmap.loadFromData( data ); @@ -53,6 +35,8 @@ image = scaledImage; this->repaint(); - map.insert(requestedUrl, scaledImage); + map.insert(source, scaledImage); + } } +