AdBlockRule: Add new rule type Invalid for invalid rules

remotes/origin/falkon
nowrep 13 years ago
parent 6f6bba66f6
commit 4a85e59778
  1. 4
      src/lib/adblock/adblockrule.cpp
  2. 5
      src/lib/adblock/adblockrule.h

@ -47,9 +47,9 @@
#include "adblockrule.h"
#include "adblocksubscription.h"
#include "qztools.h"
#include "qzregexp.h"
#include <QDebug>
#include "qzregexp.h"
#include <QUrl>
#include <QString>
#include <QStringList>
@ -362,6 +362,7 @@ void AdBlockRule::parseFilter()
// Empty rule or just comment
if (m_filter.trimmed().isEmpty() || m_filter.startsWith(QLatin1Char('!'))) {
m_isEnabled = false;
m_type = Invalid;
return;
}
@ -445,6 +446,7 @@ void AdBlockRule::parseFilter()
// If we don't handle all options, it's safer to just disable this rule
if (handledOptions != options.count()) {
m_isInternalDisabled = true;
m_type = Invalid;
return;
}

@ -106,7 +106,8 @@ private:
DomainMatchRule = 1,
RegExpMatchRule = 2,
StringEndsMatchRule = 3,
StringContainsMatchRule = 4
StringContainsMatchRule = 4,
Invalid = 5
};
enum RuleOption {
@ -153,6 +154,8 @@ private:
QStringList m_allowedDomains;
QStringList m_blockedDomains;
friend class AdBlockSearchTree;
};
#endif // ADBLOCKRULE_H

Loading…
Cancel
Save