Changeset View
Changeset View
Standalone View
Standalone View
documentation/qthelp/qthelpnetwork.h
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 49 | { | |||
---|---|---|---|---|---|
52 | 52 | | |||
53 | // Instantly finish processing if data is empty. Without this code the loadFinished() | 53 | // Instantly finish processing if data is empty. Without this code the loadFinished() | ||
54 | // signal will never be emitted by the corresponding QWebView. | 54 | // signal will never be emitted by the corresponding QWebView. | ||
55 | if (!origLen) { | 55 | if (!origLen) { | ||
56 | qCDebug(QTHELP) << "Empty data for" << request.url().toDisplayString(); | 56 | qCDebug(QTHELP) << "Empty data for" << request.url().toDisplayString(); | ||
57 | QTimer::singleShot(0, this, SIGNAL(finished())); | 57 | QTimer::singleShot(0, this, SIGNAL(finished())); | ||
58 | } | 58 | } | ||
59 | 59 | | |||
60 | // Fix broken CSS images (tested on Qt 5.5.1 and 5.7.0) | ||||
61 | if (request.url().fileName() == QStringLiteral("offline.css")) { | ||||
62 | data.replace("../images", "images"); | ||||
63 | } | ||||
64 | | ||||
60 | setHeader(QNetworkRequest::ContentTypeHeader, mimeType); | 65 | setHeader(QNetworkRequest::ContentTypeHeader, mimeType); | ||
61 | setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen)); | 66 | setHeader(QNetworkRequest::ContentLengthHeader, QByteArray::number(origLen)); | ||
62 | QTimer::singleShot(0, this, SIGNAL(metaDataChanged())); | 67 | QTimer::singleShot(0, this, SIGNAL(metaDataChanged())); | ||
63 | QTimer::singleShot(0, this, SIGNAL(readyRead())); | 68 | QTimer::singleShot(0, this, SIGNAL(readyRead())); | ||
64 | } | 69 | } | ||
65 | 70 | | |||
66 | qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) | 71 | qint64 HelpNetworkReply::readData(char *buffer, qint64 maxlen) | ||
67 | { | 72 | { | ||
▲ Show 20 Lines • Show All 41 Lines • Show Last 20 Lines |