From a4631fb9ec2541f99e1aba05cf1e7d2b5ebecb98 Mon Sep 17 00:00:00 2001 From: Benjamin Poulain Date: Thu, 19 Aug 2010 02:26:40 +0200 Subject: Add a special matcher for ad block filters for host name Quite a few rules of ad block are just matching domains. Those are of the form: ||trolltech.com^$options This patch add a new class to deal with this kind of filter, AdBlockHostMatcher. Matching a host address is much faster (O(1)) than going through the entire list of rules. --- src/adblock/adblockmanager.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/adblock/adblockmanager.h') diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h index eae761e0..69548994 100644 --- a/src/adblock/adblockmanager.h +++ b/src/adblock/adblockmanager.h @@ -108,6 +108,7 @@ #include "rekonq_defines.h" // Local Includes +#include "adblockhostmatcher.h" #include "adblockrule.h" // KDE Includes @@ -155,6 +156,8 @@ private: bool _isAdblockEnabled; bool _isHideAdsEnabled; + AdBlockHostMatcher _hostBlackList; + AdBlockHostMatcher _hostWhiteList; AdBlockRuleList _blackList; AdBlockRuleList _whiteList; QStringList _hideList; -- cgit v1.2.1