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

Don't crash on adblock menu when adblock is disabled.

This commit is contained in:
Franz Fellner 2012-10-27 13:36:48 +02:00
parent d012e7923f
commit 37da53731c

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());