summaryrefslogtreecommitdiff
path: root/src/adblock/adblockrule.cpp
diff options
context:
space:
mode:
authorPanagiotis Papadopoulos <pano_90@gmx.net>2010-02-02 23:08:40 +0100
committerPanagiotis Papadopoulos <pano_90@gmx.net>2010-02-02 23:08:40 +0100
commit5efd06bc3dd4c494aa799f5e774a9475a4fa717a (patch)
tree9540281ba60e520c5edb8949dc38766aae1b72ad /src/adblock/adblockrule.cpp
parenti18n fixes (diff)
parentrekonq 0.3.34 (diff)
downloadrekonq-5efd06bc3dd4c494aa799f5e774a9475a4fa717a.tar.xz
Merge branch 'master' of git://gitorious.org/rekonq/mainline into i18n
Diffstat (limited to 'src/adblock/adblockrule.cpp')
-rw-r--r--src/adblock/adblockrule.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/adblock/adblockrule.cpp b/src/adblock/adblockrule.cpp
index c6fe47c9..9f86ffee 100644
--- a/src/adblock/adblockrule.cpp
+++ b/src/adblock/adblockrule.cpp
@@ -52,17 +52,22 @@
* ============================================================ */
+// Self Includes
#include "adblockrule.h"
+// Qt Includes
+#include <QStringList>
#include <QDebug>
#include <QRegExp>
#include <QUrl>
+// Defines
#define QL1S(x) QLatin1String(x)
#define QL1C(x) QLatin1Char(x)
AdBlockRule::AdBlockRule(const QString &filter)
+ : m_optionMatchRule(false)
{
bool isRegExpRule = false;
@@ -75,11 +80,13 @@ AdBlockRule::AdBlockRule(const QString &filter)
isRegExpRule = true;
}
- int options = parsedLine.indexOf( QL1C('$'), 0);
- if (options >= 0)
+ int optionsNumber = parsedLine.indexOf( QL1C('$'), 0);
+ QStringList options;
+
+ if (optionsNumber >= 0)
{
- m_options = parsedLine.mid(options + 1).split(QL1C(','));
- parsedLine = parsedLine.left(options);
+ options = parsedLine.mid(optionsNumber + 1).split(QL1C(','));
+ parsedLine = parsedLine.left(optionsNumber);
}
if(!isRegExpRule)
@@ -87,10 +94,10 @@ AdBlockRule::AdBlockRule(const QString &filter)
m_regExp = QRegExp(parsedLine, Qt::CaseInsensitive, QRegExp::RegExp2);
- if (m_options.contains( QL1S("match-case") ))
+ if ( options.contains( QL1S("match-case") ))
{
m_regExp.setCaseSensitivity(Qt::CaseSensitive);
- m_options.removeOne( QL1S("match-case") );
+ m_optionMatchRule = true;
}
}