diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-05-27 19:40:47 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-05-27 19:40:47 +0200 |
commit | 93ead7b8158019d1ea5a73cd3350f44dde8a20e6 (patch) | |
tree | 69c885c6f3d5c4554cf01afadc7188ccad4a89e9 /src | |
parent | managing Network Reply Errors. STEP 1 (diff) | |
download | rekonq-93ead7b8158019d1ea5a73cd3350f44dde8a20e6.tar.xz |
Network Reply Error. STEP 2
Diffstat (limited to 'src')
-rw-r--r-- | src/webpage.cpp | 46 | ||||
-rw-r--r-- | src/webpage.h | 2 |
2 files changed, 28 insertions, 20 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp index e941d2d5..4c361f7b 100644 --- a/src/webpage.cpp +++ b/src/webpage.cpp @@ -170,6 +170,7 @@ void WebPage::manageNetworkErrors(QNetworkReply* reply) break; }; + viewErrorPage(reply); } @@ -280,7 +281,12 @@ void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply) // } // return; } + viewErrorPage(reply); +} + +void WebPage::viewErrorPage(QNetworkReply *reply) +{ // display "not found" page QString notfoundFilePath = KStandardDirs::locate("data", "rekonq/htmls/notfound.html"); QFile file(notfoundFilePath); @@ -300,26 +306,26 @@ void WebPage::slotHandleUnsupportedContent(QNetworkReply *reply) .arg(reply->errorString()) .arg(reply->url().toString()); - QList<QWebFrame*> frames; - frames.append(mainFrame()); - while (!frames.isEmpty()) - { - QWebFrame *firstFrame = frames.takeFirst(); - if (firstFrame->url() == reply->url()) - { - firstFrame->setHtml(html, reply->url()); - return; - } - QList<QWebFrame *> children = firstFrame->childFrames(); - foreach(QWebFrame *frame, children) - { - frames.append(frame); - } - } - if (m_loadingUrl == reply->url()) - { +// QList<QWebFrame*> frames; +// frames.append(mainFrame()); +// while (!frames.isEmpty()) +// { +// QWebFrame *firstFrame = frames.takeFirst(); +// if (firstFrame->url() == reply->url()) +// { +// firstFrame->setHtml(html, reply->url()); +// return; +// } +// QList<QWebFrame *> children = firstFrame->childFrames(); +// foreach(QWebFrame *frame, children) +// { +// frames.append(frame); +// } +// } +// if (m_loadingUrl == reply->url()) +// { mainFrame()->setHtml(html, reply->url()); // Don't put error pages to the history. Application::historyManager()->removeHistoryEntry(reply->url(), mainFrame()->title()); - } -} +// } +}
\ No newline at end of file diff --git a/src/webpage.h b/src/webpage.h index ba440663..5fd69702 100644 --- a/src/webpage.h +++ b/src/webpage.h @@ -69,6 +69,8 @@ protected Q_SLOTS: virtual void slotHandleUnsupportedContent(QNetworkReply *reply); private: + void viewErrorPage(QNetworkReply *); + friend class WebView; // set the webview mousepressedevent |