summaryrefslogtreecommitdiff
path: root/src/adblock/adblockmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2009-11-28 18:46:28 +0100
committerAndrea Diamantini <adjam7@gmail.com>2009-11-28 18:46:28 +0100
commit56585bc34834955a55cee8a8c1c70cb031d40fe3 (patch)
tree6b85308ac52dd9bb9cbb17c30e68529d3244a313 /src/adblock/adblockmanager.cpp
parentsrc/CMakeLists.txt fix (diff)
downloadrekonq-56585bc34834955a55cee8a8c1c70cb031d40fe3.tar.xz
removed current bugged adblock implementation.
Sorry about that :(
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;
}