diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2012-09-19 23:22:13 +0200 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2012-12-10 02:48:05 +0100 |
commit | e315ff15daf26cbc70b6f2da50e6ca18081fc7c4 (patch) | |
tree | 6da0556f2c5c7efb13d8e8b03ba0092e7a5838d3 /src/webtab/networkaccessmanager.cpp | |
parent | Implement RekonqWindow (diff) | |
download | rekonq-e315ff15daf26cbc70b6f2da50e6ca18081fc7c4.tar.xz |
Integrated spell checking for rekonq2 (lindsay's work imported)
- inline spell highlighter. This requires WebKit 2.3 to work.
- Addition of a suggested replacement word list to the context menu,
for the word right clicked on
- A standard modeless spell check dialog that works on the current
editable text (or selection).
Heavily cribbed from Dawit's work on kdewebkitpart.
oops... also a codingstyle script round here... :)
Diffstat (limited to 'src/webtab/networkaccessmanager.cpp')
-rw-r--r-- | src/webtab/networkaccessmanager.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/webtab/networkaccessmanager.cpp b/src/webtab/networkaccessmanager.cpp index e817faca..95bfa47d 100644 --- a/src/webtab/networkaccessmanager.cpp +++ b/src/webtab/networkaccessmanager.cpp @@ -85,15 +85,15 @@ static void hideBlockedElements(const QUrl& url, QWebElementCollection& collecti { for (QWebElementCollection::iterator it = collection.begin(); it != collection.end(); ++it) { - const QUrl baseUrl ((*it).webFrame()->baseUrl()); + const QUrl baseUrl((*it).webFrame()->baseUrl()); QString src = (*it).attribute(QL1S("src")); - + if (src.isEmpty()) src = (*it).evaluateJavaScript(QL1S("this.src")).toString(); if (src.isEmpty()) continue; - const QUrl resolvedUrl (baseUrl.resolved(src)); + const QUrl resolvedUrl(baseUrl.resolved(src)); if (url == resolvedUrl) { //kDebug() << "*** HIDING ELEMENT: " << (*it).tagName() << resolvedUrl; @@ -125,11 +125,11 @@ NetworkAccessManager::NetworkAccessManager(QObject *parent) QNetworkReply *NetworkAccessManager::createRequest(Operation op, const QNetworkRequest &req, QIODevice *outgoingData) { bool blocked = false; - + // Handle GET operations with AdBlock if (op == QNetworkAccessManager::GetOperation) blocked = AdBlockManager::self()->blockRequest(req); - + if (!blocked) { if (KProtocolInfo::isHelperProtocol(req.url())) @@ -162,10 +162,10 @@ void NetworkAccessManager::slotFinished(bool ok) if (!ok) return; - if(!AdBlockManager::self()->isEnabled()) + if (!AdBlockManager::self()->isEnabled()) return; - if(!AdBlockManager::self()->isHidingElements()) + if (!AdBlockManager::self()->isHidingElements()) return; QWebFrame* frame = qobject_cast<QWebFrame*>(sender()); @@ -176,10 +176,10 @@ void NetworkAccessManager::slotFinished(bool ok) if (urls.isEmpty()) return; - QWebElementCollection collection = frame->findAllElements(HIDABLE_ELEMENTS); - if (frame->parentFrame()) + QWebElementCollection collection = frame->findAllElements(HIDABLE_ELEMENTS); + if (frame->parentFrame()) collection += frame->parentFrame()->findAllElements(HIDABLE_ELEMENTS); - Q_FOREACH(const QUrl& url, urls) - hideBlockedElements(url, collection); + Q_FOREACH(const QUrl & url, urls) + hideBlockedElements(url, collection); } |