summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-03-22 11:31:05 +0100
committerAndrea Diamantini <adjam7@gmail.com>2010-03-22 11:31:05 +0100
commit1c3456d2821b73aa3f616b773499e99facf595f3 (patch)
tree2bc69a1712cef6131aae34b3585cbe01bb0f0a57
parentFirst SSL support. (diff)
downloadrekonq-1c3456d2821b73aa3f616b773499e99facf595f3.tar.xz
Fixing loading checking errors and retrieving ssl metadata.
We need just this F*****g awesome bar to show them :)
-rw-r--r--src/webpage.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/webpage.cpp b/src/webpage.cpp
index 395e9073..0da17a7b 100644
--- a/src/webpage.cpp
+++ b/src/webpage.cpp
@@ -148,6 +148,18 @@ WebPage::~WebPage()
bool WebPage::acceptNavigationRequest(QWebFrame *frame, const QNetworkRequest &request, NavigationType type)
{
+ KIO::AccessManager *manager = qobject_cast<KIO::AccessManager*>(networkAccessManager());
+ KIO::MetaData metaData = manager->requestMetaData();
+
+ // Get the SSL information sent, if any...
+ if( metaData.contains(QL1S("ssl_in_use")) )
+ {
+ WebSslInfo info;
+ info.fromMetaData(metaData.toVariant());
+ info.setUrl(request.url());
+ _sslInfo = info;
+ }
+
if(frame)
{
if ( _protHandler.preHandling(request, frame) )
@@ -287,10 +299,12 @@ void WebPage::loadFinished(bool ok)
if(_sslInfo.isValid())
{
// show an icon in the urlbar
+ kDebug() << "----------------- SSL VALID INFO!!!! ------------------";
}
else
{
// hide the icon in the urlbar
+ kDebug() << "----------------- SSL INFO NOT VALID... ------------------";
}
}
@@ -298,6 +312,7 @@ void WebPage::loadFinished(bool ok)
void WebPage::manageNetworkErrors(QNetworkReply *reply)
{
Q_ASSERT(reply);
+ WebView *v = 0;
QWebFrame* frame = qobject_cast<QWebFrame *>(reply->request().originatingObject());
const bool isMainFrameRequest = (frame == mainFrame());
@@ -343,9 +358,10 @@ void WebPage::manageNetworkErrors(QNetworkReply *reply)
case QNetworkReply::ProtocolUnknownError: // Unknown protocol
case QNetworkReply::ProtocolInvalidOperationError: // requested operation is invalid for this protocol
- // don't bother on elements loading errors:
+ // don't bother on elements loading errors:
// we'll manage just main url page ones
- if( !isMainFrameRequest )
+ v = qobject_cast<WebView *>(view());
+ if( reply->url() != v->url() )
break;
mainFrame()->setHtml( errorPage(reply), reply->url() );