summaryrefslogtreecommitdiff
path: root/src/adblock/adblockmanager.cpp
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-14 01:24:35 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-14 01:24:55 +0200
commit343a67e61ed6c85fc37a91cffa1926412cb097b7 (patch)
tree52f9e86dffece69c7dfb5bfe54a7a086cdc3f2fe /src/adblock/adblockmanager.cpp
parentMerge commit 'refs/merge-requests/2256' of git://gitorious.org/rekonq/mainlin... (diff)
parentMove adblock rules conf file to appdata, to maintain central config file tiny (diff)
downloadrekonq-343a67e61ed6c85fc37a91cffa1926412cb097b7.tar.xz
Merge branch 'FixBlocks'
WARNING: as we have a new adblock file, adblock will not work until rekonq doesn't update subscriptions. In some test installations, you can force rekonq doing it by removing your $KDEHOME/share/config/rekonqrc file :)
Diffstat (limited to 'src/adblock/adblockmanager.cpp')
-rw-r--r--src/adblock/adblockmanager.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index e195c705..48e2369d 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -56,6 +56,9 @@ AdBlockManager::AdBlockManager(QObject *parent)
AdBlockManager::~AdBlockManager()
{
+ _whiteList.clear();
+ _blackList.clear();
+ _hideList.clear();
}
@@ -77,9 +80,9 @@ void AdBlockManager::loadSettings(bool checkUpdateDate)
// just to be sure..
_isHideAdsEnabled = ReKonfig::hideAdsEnabled();
-
- // local settings
- KSharedConfig::Ptr config = KGlobal::config();
+
+ // read settings
+ KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata");
KConfigGroup rulesGroup(config, "rules");
QStringList rules;
rules = rulesGroup.readEntry("local-rules" , QStringList());
@@ -303,7 +306,7 @@ void AdBlockManager::saveRules(const QStringList &rules)
QStringList titles = ReKonfig::subscriptionTitles();
QString title = titles.at(_index) + "-rules";
- KSharedConfig::Ptr config = KGlobal::config();
+ KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata");
KConfigGroup cg(config , "rules");
cg.writeEntry(title, cleanedRules);
}