diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2009-12-02 11:42:10 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2009-12-02 11:42:10 +0100 |
commit | 9a25b11cc97f453b4c82d68c76a8c4026fd62b21 (patch) | |
tree | b94c77619f84ff57cf4c01e3110871f07df27da5 /src/adblock/adblockmanager.cpp | |
parent | rekonq 0.3.18 (diff) | |
download | rekonq-9a25b11cc97f453b4c82d68c76a8c4026fd62b21.tar.xz |
trade-off: speed vs mem saving.
This time I decided for speed..
Diffstat (limited to 'src/adblock/adblockmanager.cpp')
-rw-r--r-- | src/adblock/adblockmanager.cpp | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp index 4f4cff51..bfdbd5ad 100644 --- a/src/adblock/adblockmanager.cpp +++ b/src/adblock/adblockmanager.cpp @@ -30,7 +30,6 @@ // Local Includes #include "adblocknetworkreply.h" -#include "adblockrule.h" // KDE Includes #include <KSharedConfig> @@ -76,7 +75,8 @@ void AdBlockManager::loadSettings() if (name.startsWith(QLatin1String("Filter"))) { - filterList << url; + AdBlockRule filter(url); + filterList << filter; } } } @@ -95,30 +95,14 @@ QNetworkReply *AdBlockManager::block(const QNetworkRequest &request) QString urlString = request.url().toString(); kDebug() << "****************************** ADBLOCK: Matching url: "<< urlString; - foreach(const QString &filter, filterList) + foreach(const AdBlockRule &filter, filterList) { - AdBlockRule rule(filter); - if(rule.match(urlString)) + if(filter.match(urlString)) { kDebug() << "****ADBLOCK: Matched: **************************"; AdBlockNetworkReply *reply = new AdBlockNetworkReply(request, urlString, this); return reply; } } - - - - // Check the blacklist, and only if that matches, the whitelist - - - - - -// if(_adBlackList.isUrlMatched(urlString) && !_adWhiteList.isUrlMatched(urlString)) -// { -// kDebug() << "****ADBLOCK: Matched: **************************"; -// AdBlockNetworkReply *reply = new AdBlockNetworkReply(request, urlString, this); -// return reply; -// } return 0; } |