summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrea Diamantini <adjam7@gmail.com>2011-08-12 12:46:28 +0200
committerAndrea Diamantini <adjam7@gmail.com>2011-08-12 12:46:28 +0200
commitdbbea3ebeb5f2d11830962861d12b06f4b8203f4 (patch)
tree5dcd8d4582764146635e26fda823d2a71f79412e /src
parentUse KXMLGui to create rekonq menu (diff)
downloadrekonq-dbbea3ebeb5f2d11830962861d12b06f4b8203f4.tar.xz
Fix non const code in the adblockwidget
CCMAIL: fritz_van_tom@hotmail.com
Diffstat (limited to 'src')
-rw-r--r--src/adblock/adblockwidget.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/adblock/adblockwidget.cpp b/src/adblock/adblockwidget.cpp
index ad8bd599..29281786 100644
--- a/src/adblock/adblockwidget.cpp
+++ b/src/adblock/adblockwidget.cpp
@@ -108,19 +108,19 @@ void AdBlockWidget::removeRule()
void AdBlockWidget::load()
{
- bool isAdBlockEnabled = ReKonfig::adBlockEnabled();
+ const bool isAdBlockEnabled = ReKonfig::adBlockEnabled();
checkEnableAdblock->setChecked(isAdBlockEnabled);
// update enabled status
checkHideAds->setEnabled(checkEnableAdblock->isChecked());
tabWidget->setEnabled(checkEnableAdblock->isChecked());
- bool areImageFiltered = ReKonfig::hideAdsEnabled();
+ const bool areImageFiltered = ReKonfig::hideAdsEnabled();
checkHideAds->setChecked(areImageFiltered);
- int days = ReKonfig::updateInterval();
+ const int days = ReKonfig::updateInterval();
spinBox->setValue(days);
- QStringList subscriptions = ReKonfig::subscriptionTitles();
+ const QStringList subscriptions = ReKonfig::subscriptionTitles();
// load automatic rules
foreach(const QString & sub, subscriptions)
@@ -133,7 +133,7 @@ void AdBlockWidget::load()
// load local rules
KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata");
KConfigGroup localGroup(config, "rules");
- QStringList rules = localGroup.readEntry("local-rules" , QStringList());
+ const QStringList rules = localGroup.readEntry("local-rules" , QStringList());
foreach(const QString & rule, rules)
{
listWidget->addItem(rule);
@@ -159,15 +159,13 @@ void AdBlockWidget::loadRules(QTreeWidgetItem *item)
void AdBlockWidget::save()
{
- int n;
-
// local rules
KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata");
KConfigGroup localGroup(config , "rules");
QStringList localRules;
- n = listWidget->count();
+ const int n = listWidget->count();
for (int i = 0; i < n; ++i)
{
QListWidgetItem *item = listWidget->item(i);