mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
AdBlockRule: Add new rule type Invalid for invalid rules
This commit is contained in:
parent
6f6bba66f6
commit
4a85e59778
@ -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…
Reference in New Issue
Block a user