summaryrefslogtreecommitdiff
path: root/src/adblock/adblockrule.h
diff options
context:
space:
mode:
authorBenjamin Poulain <benjamin.poulain@nokia.com>2010-08-18 03:32:50 +0200
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-08-18 05:04:39 +0200
commitd9028baf5c8261cbad540893465965730386a1cf (patch)
tree2c8f21d2d2dcdd1b74f21f146cd8c6094cb155fc /src/adblock/adblockrule.h
parentRemove the method pattern() from AdBlockRule (diff)
downloadrekonq-d9028baf5c8261cbad540893465965730386a1cf.tar.xz
Split AdBlock rule in two classes to move the implementation out of it
In order to make special matching rules, we need specialization of the implementation depending on the type of rule. The previous AdBlockRule was entierly based on regexp. The new one is only a factory to a AdBlockRuleImpl, and delegate everything to this implementation. This will allow faster specialization of the ad block rules in the future.
Diffstat (limited to 'src/adblock/adblockrule.h')
-rw-r--r--src/adblock/adblockrule.h18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/adblock/adblockrule.h b/src/adblock/adblockrule.h
index 1cd9ea49..04409688 100644
--- a/src/adblock/adblockrule.h
+++ b/src/adblock/adblockrule.h
@@ -58,25 +58,25 @@
// Rekonq Includes
#include "rekonq_defines.h"
-// Qt Includes
-#include <QtCore/QRegExp>
-#include <QtCore/QString>
+#include "adblockruleimpl.h"
-// Forward Includes
-class QUrl;
+#include <QSharedPointer>
+// Forward Includes
+class QString;
class AdBlockRule
{
public:
AdBlockRule(const QString &filter);
- bool match(const QString &encodedUrl) const;
+ bool match(const QString &encodedUrl) const
+ {
+ return m_implementation->match(encodedUrl);
+ }
private:
- QString convertPatternToRegExp(const QString &wildcardPattern);
-
- QRegExp m_regExp;
+ QSharedPointer<AdBlockRuleImpl> m_implementation;
};