Skip to content
This repository
Fetching contributors…

Cannot retrieve contributors at this time

file 18 lines (14 sloc) 0.551 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
#include "Source.h"
#include "WebPage.h"
#include "WebPageManager.h"

Source::Source(WebPageManager *manager, QStringList &arguments, QObject *parent) : SocketCommand(manager, arguments, parent) {
}

void Source::start() {
  QNetworkAccessManager* accessManager = page()->networkAccessManager();
  QNetworkRequest request(page()->currentFrame()->url());
  reply = accessManager->get(request);

  connect(reply, SIGNAL(finished()), this, SLOT(sourceLoaded()));
}

void Source::sourceLoaded() {
  emit finished(new Response(true, reply->readAll()));
}
Something went wrong with that request. Please try again.