1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

Merge pull request #624 from ff2000/master

Don't crash on adblock menu when adblock is disabled.
This commit is contained in:
David Rosca 2012-10-27 05:46:10 -07:00
commit 363b1716f4

View File

@ -111,7 +111,7 @@ void AdBlockIcon::createMenu(QMenu* menu)
menu->addAction(tr("Show AdBlock &Settings"), manager, SLOT(showDialog())); menu->addAction(tr("Show AdBlock &Settings"), manager, SLOT(showDialog()));
menu->addSeparator(); menu->addSeparator();
if (!pageUrl.isEmpty()) { if (!pageUrl.isEmpty() && m_enabled) {
const QString &host = page->url().host().contains(QLatin1String("www.")) ? pageUrl.host().mid(4) : pageUrl.host(); const QString &host = page->url().host().contains(QLatin1String("www.")) ? pageUrl.host().mid(4) : pageUrl.host();
const QString &hostFilter = QString("@@||%1^$document").arg(host); const QString &hostFilter = QString("@@||%1^$document").arg(host);
const QString &pageFilter = QString("@@|%1|$document").arg(pageUrl.toString()); const QString &pageFilter = QString("@@|%1|$document").arg(pageUrl.toString());