summaryrefslogtreecommitdiff
path: root/src/adblock/adblockmanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/adblock/adblockmanager.cpp')
-rw-r--r--src/adblock/adblockmanager.cpp38
1 files changed, 1 insertions, 37 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index a0bc4e00..b25edcb1 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -28,9 +28,6 @@
#include "adblockmanager.moc"
-// Local Includes
-#include "adblockrule.h"
-
// KDE Includes
#include <KSharedConfig>
#include <KConfigGroup>
@@ -56,43 +53,10 @@ AdBlockManager::~AdBlockManager()
void AdBlockManager::loadSettings()
{
- KSharedConfig::Ptr config = KSharedConfig::openConfig("khtmlrc", KConfig::NoGlobals);
- KConfigGroup cg( config, "Filter Settings" );
-
- if ( cg.exists() )
- {
- _isAdblockEnabled = cg.readEntry("Enabled", false);
- _isHideAdsEnabled = cg.readEntry("Shrink", false);
-
- _adBlackList.clear();
- _adWhiteList.clear();
-
- QMap<QString,QString> entryMap = cg.entryMap();
- QMap<QString,QString>::ConstIterator it;
- for( it = entryMap.constBegin(); it != entryMap.constEnd(); ++it )
- {
- QString name = it.key();
- QString url = it.value();
-
- if (name.startsWith(QLatin1String("Filter")))
- {
- if (url.startsWith(QLatin1String("@@")))
- _adWhiteList.addFilter(url);
- else
- _adBlackList.addFilter(url);
- }
- }
- }
}
bool AdBlockManager::isUrlAllowed(const QUrl &url)
{
- if (!_isAdblockEnabled)
- return true;
-
- QString urlString = QString::fromUtf8(url.toEncoded());
-
- // Check the blacklist, and only if that matches, the whitelist
- return _adBlackList.isUrlMatched(urlString) && !_adWhiteList.isUrlMatched(urlString);
+ return true;
}