Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (22 sloc) 0.911 kB
#include "UnsupportedContentHandler.h"
#include "WebPage.h"
#include <QNetworkReply>
UnsupportedContentHandler::UnsupportedContentHandler(WebPage *page, QNetworkReply *reply, QObject *parent) : QObject(parent) {
m_page = page;
m_reply = reply;
}
void UnsupportedContentHandler::renderNonHtmlContent() {
QByteArray text = m_reply->readAll();
m_page->mainFrame()->setContent(text, QString("text/plain"), m_reply->url());
m_page->networkAccessManagerFinishedReply(m_reply);
m_page->loadFinished(true);
this->deleteLater();
}
void UnsupportedContentHandler::waitForReplyToFinish() {
connect(m_reply, SIGNAL(finished()), this, SLOT(replyFinished()));
disconnect(m_page, SIGNAL(loadFinished(bool)), m_page, SLOT(loadFinished(bool)));
}
void UnsupportedContentHandler::replyFinished() {
renderNonHtmlContent();
connect(m_page, SIGNAL(loadFinished(bool)), m_page, SLOT(loadFinished(bool)));
}
Jump to Line
Something went wrong with that request. Please try again.