mirror of
https://github.com/thoughtbot/capybara-webkit
synced 2023-03-27 23:22:28 -04:00
18 lines
504 B
C++
18 lines
504 B
C++
#include "Source.h"
|
|
#include "WebPage.h"
|
|
|
|
Source::Source(WebPage *page, QStringList &arguments, QObject *parent) : Command(page, 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()));
|
|
}
|
|
|