From 50f91796e0c4a4d23b4961fbc775a762f4ea3909 Mon Sep 17 00:00:00 2001 From: Andrea Diamantini Date: Fri, 14 May 2010 01:07:14 +0200 Subject: Move adblock rules conf file to appdata, to maintain central config file tiny --- src/adblock/adblockmanager.cpp | 8 +- src/rekonq.kcfg | 167 +++++++++++++++++++++-------------------- src/settings/adblockwidget.cpp | 6 +- 3 files changed, 93 insertions(+), 88 deletions(-) (limited to 'src') diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp index 9080aa66..48e2369d 100644 --- a/src/adblock/adblockmanager.cpp +++ b/src/adblock/adblockmanager.cpp @@ -80,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()); @@ -306,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); } diff --git a/src/rekonq.kcfg b/src/rekonq.kcfg index 3658b324..86e47534 100644 --- a/src/rekonq.kcfg +++ b/src/rekonq.kcfg @@ -34,18 +34,20 @@ + - + KDE Homepage,UserBase,rekonq site http://www.kde.org,http://userbase.kde.org,http://rekonq.sourceforge.net - + + - + 1 @@ -67,10 +69,11 @@ 0 - + + - + true @@ -89,99 +92,101 @@ false - + - + - QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont)) + QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont)) - QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::FixedFont)) + QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::FixedFont)) - 16 + 16 - 8 + 8 - + + - - - 1 - - + + + 1 + + + - - - true - - - true - - - true - - - true - - - 0 - - - true - - - false - - - true - - - false - - - true - - - true - - - true - - - true - - - - - + + + true + + + true + + + true + + + true + + + 0 + + + true + + + false + + + true + + + false + + + true + + + true + + + true + + + true + + + + + - - - true - - - true - - - EasyList - - - https://easylist-downloads.adblockplus.org/easylist.txt - - - QDateTime(QDate(2009,03,13)) - - - 7 - - + + + true + + + true + + + EasyList + + + https://easylist-downloads.adblockplus.org/easylist.txt + + + QDateTime(QDate(2009,03,13)) + + + 7 + + diff --git a/src/settings/adblockwidget.cpp b/src/settings/adblockwidget.cpp index 59cb8a81..412f03d9 100644 --- a/src/settings/adblockwidget.cpp +++ b/src/settings/adblockwidget.cpp @@ -126,7 +126,7 @@ void AdBlockWidget::load() } // load local rules - KSharedConfig::Ptr config = KGlobal::config(); + KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata"); KConfigGroup localGroup(config, "rules"); QStringList rules = localGroup.readEntry("local-rules" , QStringList()); foreach(const QString &rule, rules) @@ -138,7 +138,7 @@ void AdBlockWidget::load() void AdBlockWidget::loadRules(QTreeWidgetItem *item) { - KSharedConfig::Ptr config = KGlobal::config(); + KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata"); KConfigGroup localGroup(config, "rules"); QString str = item->text(0) + "-rules"; @@ -157,7 +157,7 @@ void AdBlockWidget::save() int n; // local rules - KSharedConfig::Ptr config = KGlobal::config(); + KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata"); KConfigGroup localGroup(config , "rules"); QStringList localRules; -- cgit v1.2.1