1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 18:26:34 +01:00

AdBlock: Fix issue when enabling rule didn't work until restart.

When attempting to enable rule that was already disabled on startup,
it won't have an effect until completely restarting the browser.
This commit is contained in:
nowrep 2013-11-04 16:03:11 +01:00
parent 2abefeaf79
commit 5fbf11c8f2
3 changed files with 14 additions and 1 deletions

View File

@ -9,6 +9,7 @@ Version 1.5.0
* added KWallet password backend plugin * added KWallet password backend plugin
* added Gnome-Keyring password backend plugin * added Gnome-Keyring password backend plugin
* added StatusBar Icons plugin that adds extra icons to statusbar * added StatusBar Icons plugin that adds extra icons to statusbar
* great performance improvement for matching basic rules in AdBlock
* themes can now be loaded from profile directories * themes can now be loaded from profile directories
* pagescreen can now save output into number of formats, including PDF * pagescreen can now save output into number of formats, including PDF
* proxy exceptions now supports wildcards (*, ?) * proxy exceptions now supports wildcards (*, ?)
@ -23,6 +24,7 @@ Version 1.5.0
* fixed: size of preferences dialog on low-res screens * fixed: size of preferences dialog on low-res screens
* fixed: loading plugins with relative paths in portable build * fixed: loading plugins with relative paths in portable build
* fixed: displaying a lot of RSS feeds in RSS widget in locationbar * fixed: displaying a lot of RSS feeds in RSS widget in locationbar
* fixed: enabling disabled rules in AdBlock now works everytime
Version 1.4.4 Version 1.4.4
* released 1 September 2013 * released 1 September 2013

View File

@ -361,7 +361,10 @@ void AdBlockRule::parseFilter()
// Empty rule or just comment // Empty rule or just comment
if (m_filter.trimmed().isEmpty() || m_filter.startsWith(QLatin1Char('!'))) { if (m_filter.trimmed().isEmpty() || m_filter.startsWith(QLatin1Char('!'))) {
// We want to differentiate rule disabled by user and rule disabled in subscription file
// m_isInternalDisabled is also used when rule is disabled due to all options not being supported
m_isEnabled = false; m_isEnabled = false;
m_isInternalDisabled = true;
m_type = Invalid; m_type = Invalid;
return; return;
} }

View File

@ -392,11 +392,19 @@ void AdBlockSubscription::populateCache()
int count = m_rules.count(); int count = m_rules.count();
for (int i = 0; i < count; ++i) { for (int i = 0; i < count; ++i) {
const AdBlockRule* rule = m_rules.at(i); const AdBlockRule* rule = m_rules.at(i);
if (!rule->isEnabled()) {
// Don't add internally disabled rules to cache
if (rule->isInternalDisabled()) {
continue; continue;
} }
if (rule->isCssRule()) { if (rule->isCssRule()) {
// We will add only enabled css rules to cache, because there is no enabled/disabled
// check on match. They are directly embedded to pages.
if (!rule->isEnabled()) {
continue;
}
if (rule->isDomainRestricted()) { if (rule->isDomainRestricted()) {
m_domainRestrictedCssRules.append(rule); m_domainRestrictedCssRules.append(rule);
} }