const AdBlockRule* AdBlockSubscription::disableRule(int offset) { if (!QzTools::vectorContainsIndex(m_rules, offset)) { return 0; } AdBlockRule* rule = m_rules[offset]; rule->setEnabled(false); AdBlockManager::instance()->addDisabledRule(rule->filter()); if (rule->isCssRule()) { populateCache(); mApp->reloadUserStyleSheet(); } return rule; }
const AdBlockRule* AdBlockSubscription::enableRule(int offset) { if (!QzTools::containsIndex(m_rules, offset)) { return 0; } AdBlockRule* rule = m_rules[offset]; rule->setEnabled(true); AdBlockManager::instance()->removeDisabledRule(rule->filter()); emit subscriptionChanged(); if (rule->isCssRule()) mApp->reloadUserStyleSheet(); return rule; }