diff options
Diffstat (limited to 'src/adblock/blockedelementswidget.cpp')
-rw-r--r-- | src/adblock/blockedelementswidget.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/adblock/blockedelementswidget.cpp b/src/adblock/blockedelementswidget.cpp index 58b96299..8c02134f 100644 --- a/src/adblock/blockedelementswidget.cpp +++ b/src/adblock/blockedelementswidget.cpp @@ -92,18 +92,25 @@ void BlockedElementsWidget::unblockElement() if (!buttonClicked) return; - QString newText = i18n("Unblocked"); - if (buttonClicked->text() == newText) - return; - - QString urlString = buttonClicked->property("URLTOUNBLOCK").toString(); + QString urlString = QL1S("@@") + buttonClicked->property("URLTOUNBLOCK").toString(); kDebug() << "urlString: " << urlString; - buttonClicked->setText(newText); - buttonClicked->setIcon(KIcon("dialog-ok")); + QString newText = i18n("Unblocked"); + QString buttonText = buttonClicked->text().remove('&'); + if (buttonText == newText) + { + buttonClicked->setText(i18n("Unblock")); + buttonClicked->setIcon(KIcon("dialog-ok-apply")); - AdBlockManager *m = qobject_cast<AdBlockManager *>(_manager); - m->addCustomRule(QL1S("@@") + urlString, false); + _rulesToAdd.removeOne(urlString); + } + else + { + buttonClicked->setText(newText); + buttonClicked->setIcon(KIcon("dialog-ok")); + _rulesToAdd << urlString; + } + _reloadPage = true; } |