summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2010-05-14 01:07:14 +0200
committerAndrea Diamantini <adjam7@gmail.com>2010-05-14 01:07:14 +0200
commit50f91796e0c4a4d23b4961fbc775a762f4ea3909 (patch)
tree1ea0d7daa8d1c4c829a780d5af2fb540f02f84ec
parentAdBlock clean up, step 1 (diff)
downloadrekonq-50f91796e0c4a4d23b4961fbc775a762f4ea3909.tar.xz
Move adblock rules conf file to appdata, to maintain central config file tiny
-rw-r--r--src/adblock/adblockmanager.cpp8
-rw-r--r--src/rekonq.kcfg167
-rw-r--r--src/settings/adblockwidget.cpp6
3 files changed, 93 insertions, 88 deletions
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 @@
</entry>
</group>
+
<!-- New Tab Page Settings -->
- <group name="NewTabPage">
+<group name="NewTabPage">
<entry name="previewNames" type="StringList">
<default>KDE Homepage,UserBase,rekonq site</default>
</entry>
<entry name="previewUrls" type="StringList">
<default>http://www.kde.org,http://userbase.kde.org,http://rekonq.sourceforge.net</default>
</entry>
- </group>
+</group>
+
<!-- General Settings -->
- <group name="General">
+<group name="General">
<entry name="startupBehaviour" type="Int">
<default>1</default>
</entry>
@@ -67,10 +69,11 @@
<entry name="searchEngine" type="Int">
<default>0</default>
</entry>
- </group>
+</group>
+
<!-- Tabs Settings -->
- <group name="Tabs">
+<group name="Tabs">
<entry name="openTabNoWindow" type="Bool">
<default>true</default>
</entry>
@@ -89,99 +92,101 @@
<entry name="closeTabSelectPrevious" type="Bool">
<default>false</default>
</entry>
- </group>
+</group>
<!-- Fonts Settings -->
- <group name="Fonts">
+<group name="Fonts">
<entry name="standardFont" type="Font">
- <default code="true">QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont))</default>
+ <default code="true">QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::StandardFont))</default>
</entry>
<entry name="fixedFont" type="Font">
- <default code="true">QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::FixedFont))</default>
+ <default code="true">QFont(QWebSettings::globalSettings()->fontFamily(QWebSettings::FixedFont))</default>
</entry>
<entry name="fontSize" type="Int">
- <default>16</default>
+ <default>16</default>
</entry>
<entry name="minFontSize" type="Int">
- <default>8</default>
+ <default>8</default>
</entry>
- </group>
+</group>
+
<!-- Privacy Settings -->
- <group name="Privacy">
- <entry name="expireHistory" type="Int">
- <default>1</default>
- </entry>
- </group>
+<group name="Privacy">
+ <entry name="expireHistory" type="Int">
+ <default>1</default>
+ </entry>
+</group>
+
<!-- WebKit Settings -->
- <group name="Webkit">
- <entry name="autoLoadImages" type="Bool">
- <default>true</default>
- </entry>
- <entry name="dnsPrefetch" type="Bool">
- <default>true</default>
- </entry>
- <entry name="javascriptEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="javaEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="pluginsEnabled" type="Int">
- <default>0</default>
- </entry>
- <entry name="javascriptCanOpenWindows" type="Bool">
- <default>true</default>
- </entry>
- <entry name="javascriptCanAccessClipboard" type="Bool">
- <default>false</default>
- </entry>
- <entry name="linksIncludedInFocusChain" type="Bool">
- <default>true</default>
- </entry>
- <entry name="zoomTextOnly" type="Bool">
- <default>false</default>
- </entry>
- <entry name="printElementBackgrounds" type="Bool">
- <default>true</default>
- </entry>
- <entry name="offlineStorageDatabaseEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="offlineWebApplicationCacheEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="localStorageEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="userCSS" type="Url">
- <default></default>
- </entry>
- </group>
+<group name="Webkit">
+ <entry name="autoLoadImages" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="dnsPrefetch" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="javascriptEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="javaEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="pluginsEnabled" type="Int">
+ <default>0</default>
+ </entry>
+ <entry name="javascriptCanOpenWindows" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="javascriptCanAccessClipboard" type="Bool">
+ <default>false</default>
+ </entry>
+ <entry name="linksIncludedInFocusChain" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="zoomTextOnly" type="Bool">
+ <default>false</default>
+ </entry>
+ <entry name="printElementBackgrounds" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="offlineStorageDatabaseEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="offlineWebApplicationCacheEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="localStorageEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="userCSS" type="Url">
+ <default></default>
+ </entry>
+</group>
<!-- AdBlock Settings -->
- <group name="AdBlock">
- <entry name="adBlockEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="hideAdsEnabled" type="Bool">
- <default>true</default>
- </entry>
- <entry name="subscriptionTitles" type="StringList">
- <default>EasyList</default>
- </entry>
- <entry name="subscriptionLocations" type="StringList">
- <default>https://easylist-downloads.adblockplus.org/easylist.txt</default>
- </entry>
- <entry name="lastUpdate" type="DateTime">
- <default>QDateTime(QDate(2009,03,13))</default>
- </entry>
- <entry name="updateInterval" type="Int">
- <default>7</default>
- </entry>
- </group>
+<group name="AdBlock">
+ <entry name="adBlockEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="hideAdsEnabled" type="Bool">
+ <default>true</default>
+ </entry>
+ <entry name="subscriptionTitles" type="StringList">
+ <default>EasyList</default>
+ </entry>
+ <entry name="subscriptionLocations" type="StringList">
+ <default>https://easylist-downloads.adblockplus.org/easylist.txt</default>
+ </entry>
+ <entry name="lastUpdate" type="DateTime">
+ <default>QDateTime(QDate(2009,03,13))</default>
+ </entry>
+ <entry name="updateInterval" type="Int">
+ <default>7</default>
+ </entry>
+</group>
</kcfg>
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;