mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 09:32:12 +01:00
AdBlock: Fix updating rules when adding/removing subscriptions
This also fixes crash on first network request after removing subscription
This commit is contained in:
parent
7391a6403c
commit
53bf6662dc
|
@ -200,6 +200,8 @@ AdBlockSubscription* AdBlockManager::addSubscription(const QString &title, const
|
||||||
subscription->loadSubscription(m_disabledRules);
|
subscription->loadSubscription(m_disabledRules);
|
||||||
|
|
||||||
m_subscriptions.insert(m_subscriptions.count() - 1, subscription);
|
m_subscriptions.insert(m_subscriptions.count() - 1, subscription);
|
||||||
|
connect(subscription, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet()));
|
||||||
|
connect(subscription, SIGNAL(subscriptionChanged()), m_matcher, SLOT(update()));
|
||||||
|
|
||||||
return subscription;
|
return subscription;
|
||||||
}
|
}
|
||||||
|
@ -213,7 +215,9 @@ bool AdBlockManager::removeSubscription(AdBlockSubscription* subscription)
|
||||||
QFile(subscription->filePath()).remove();
|
QFile(subscription->filePath()).remove();
|
||||||
m_subscriptions.removeOne(subscription);
|
m_subscriptions.removeOne(subscription);
|
||||||
|
|
||||||
|
m_matcher->update();
|
||||||
delete subscription;
|
delete subscription;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user