1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Prevent endless loop when getting Unsupported Content error

This commit is contained in:
nowrep 2012-03-13 16:43:23 +01:00
parent 17d70adfa5
commit 3a9c4f104b
2 changed files with 8 additions and 3 deletions

View File

@ -51,6 +51,7 @@
QString WebPage::m_lastUploadLocation = QDir::homePath();
QString WebPage::m_userAgent = QString();
QUrl WebPage::m_lastUnsupportedUrl = QUrl();
WebPage::WebPage(QupZilla* mainClass)
: QWebPage()
@ -245,9 +246,12 @@ void WebPage::handleUnsupportedContent(QNetworkReply* reply)
case QNetworkReply::ProtocolUnknownError: {
qDebug() << "WebPage::UnsupportedContent" << url << "ProtocolUnknowError";
// We will open only known url schemes that we cannot handle
const QString &urlScheme = url.scheme();
if (urlScheme == "ftp" || urlScheme == "mailto") {
// We will open last unsupported url only once
// (to prevent endless loop in case QDesktopServices::openUrl decide
// to open the url again in QupZilla )
if (m_lastUnsupportedUrl != url) {
m_lastUnsupportedUrl = url;
QDesktopServices::openUrl(url);
}

View File

@ -99,6 +99,7 @@ private:
static QString m_lastUploadLocation;
static QString m_userAgent;
static QUrl m_lastUnsupportedUrl;
QupZilla* p_QupZilla;
NetworkManagerProxy* m_networkProxy;