summaryrefslogtreecommitdiff
path: root/src/adblock
diff options
context:
space:
mode:
Diffstat (limited to 'src/adblock')
-rw-r--r--src/adblock/adblockmanager.cpp18
-rw-r--r--src/adblock/adblockmanager.h4
-rw-r--r--src/adblock/adblocknetworkreply.h4
-rw-r--r--src/adblock/adblockrulefallbackimpl.cpp4
-rw-r--r--src/adblock/adblockwidget.cpp6
-rw-r--r--src/adblock/adblockwidget.h6
6 files changed, 21 insertions, 21 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index b18547ad..0f91c02f 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -108,7 +108,7 @@ void AdBlockManager::loadSettings(bool checkUpdateDate)
// else
QStringList titles = ReKonfig::subscriptionTitles();
- foreach(const QString & title, titles)
+ Q_FOREACH(const QString & title, titles)
{
rules = rulesGroup.readEntry(title + "-rules" , QStringList());
loadRules(rules);
@@ -118,7 +118,7 @@ void AdBlockManager::loadSettings(bool checkUpdateDate)
void AdBlockManager::loadRules(const QStringList &rules)
{
- foreach(const QString & stringRule, rules)
+ Q_FOREACH(const QString & stringRule, rules)
{
// ! rules are comments
if (stringRule.startsWith('!'))
@@ -187,7 +187,7 @@ QNetworkReply *AdBlockManager::block(const QNetworkRequest &request, WebPage *pa
return 0;
}
- foreach(const AdBlockRule & filter, _whiteList)
+ Q_FOREACH(const AdBlockRule & filter, _whiteList)
{
if (filter.match(request, urlString, urlStringLowerCase))
{
@@ -208,7 +208,7 @@ QNetworkReply *AdBlockManager::block(const QNetworkRequest &request, WebPage *pa
if (!page)
return 0;
- foreach(const AdBlockRule & filter, _blackList)
+ Q_FOREACH(const AdBlockRule & filter, _blackList)
{
if (filter.match(request, urlString, urlStringLowerCase))
{
@@ -216,7 +216,7 @@ QNetworkReply *AdBlockManager::block(const QNetworkRequest &request, WebPage *pa
QWebElement document = page->mainFrame()->documentElement();
QWebElementCollection elements = document.findAll("*");
- foreach(QWebElement el, elements)
+ Q_FOREACH(QWebElement el, elements)
{
const QString srcAttribute = el.attribute("src");
if (filter.match(request, srcAttribute, srcAttribute.toLower()))
@@ -251,11 +251,11 @@ void AdBlockManager::applyHidingRules(WebPage *page)
QWebElement document = page->mainFrame()->documentElement();
// HIDE RULES
- foreach(const QString & filter, _hideList)
+ Q_FOREACH(const QString & filter, _hideList)
{
QWebElementCollection elements = document.findAll(filter);
- foreach(QWebElement el, elements)
+ Q_FOREACH(QWebElement el, elements)
{
if (el.isNull())
continue;
@@ -301,7 +301,7 @@ void AdBlockManager::slotResult(KJob *job)
QList<QByteArray> list = _buffer.split('\n');
QStringList ruleList;
- foreach(const QByteArray & ba, list)
+ Q_FOREACH(const QByteArray & ba, list)
{
ruleList << QString(ba);
}
@@ -331,7 +331,7 @@ void AdBlockManager::subscriptionData(KIO::Job* job, const QByteArray& data)
void AdBlockManager::saveRules(const QStringList &rules)
{
QStringList cleanedRules;
- foreach(const QString & r, rules)
+ Q_FOREACH(const QString & r, rules)
{
if (!r.startsWith('!') && !r.startsWith('[') && !r.isEmpty())
cleanedRules << r;
diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h
index 216764eb..f220082a 100644
--- a/src/adblock/adblockmanager.h
+++ b/src/adblock/adblockmanager.h
@@ -157,7 +157,7 @@ public:
void applyHidingRules(WebPage *page);
void addSubscription(const QString &title, const QString &location);
-public slots:
+public Q_SLOTS:
void loadSettings(bool checkUpdateDate = true);
void showSettings();
@@ -166,7 +166,7 @@ private:
void saveRules(const QStringList &);
void loadRules(const QStringList &);
-private slots:
+private Q_SLOTS:
void slotResult(KJob *);
void subscriptionData(KIO::Job*, const QByteArray&);
diff --git a/src/adblock/adblocknetworkreply.h b/src/adblock/adblocknetworkreply.h
index 9b5c48da..f85868b8 100644
--- a/src/adblock/adblocknetworkreply.h
+++ b/src/adblock/adblocknetworkreply.h
@@ -3,7 +3,7 @@
* This file is a part of the rekonq project
*
* Copyright (c) 2009 by Benjamin C. Meyer <ben@meyerhome.net>
- * Copyright (C) 2010 by Andrea Diamantini <adjam7 at gmail dot com>
+ * Copyright (C) 2010-2011 by Andrea Diamantini <adjam7 at gmail dot com>
*
*
* This program is free software; you can redistribute it and/or
@@ -50,7 +50,7 @@ public:
protected:
qint64 readData(char *data, qint64 maxSize);
-private slots:
+private Q_SLOTS:
void delayedFinished();
};
diff --git a/src/adblock/adblockrulefallbackimpl.cpp b/src/adblock/adblockrulefallbackimpl.cpp
index 36aabc30..27fc4345 100644
--- a/src/adblock/adblockrulefallbackimpl.cpp
+++ b/src/adblock/adblockrulefallbackimpl.cpp
@@ -64,14 +64,14 @@ AdBlockRuleFallbackImpl::AdBlockRuleFallbackImpl(const QString &filter)
if (options.contains(QL1S("third-party")))
m_thirdPartyOption = true;
- foreach(const QString & option, options)
+ Q_FOREACH(const QString & option, options)
{
// Domain restricted filter
const QString domainKeyword(QL1S("domain="));
if (option.startsWith(domainKeyword))
{
QStringList domainList = option.mid(domainKeyword.length()).split(QL1C('|'));
- foreach(const QString & domain, domainList)
+ Q_FOREACH(const QString & domain, domainList)
{
if (domain.startsWith(QL1C('~')))
m_whiteDomains.insert(domain.toLower());
diff --git a/src/adblock/adblockwidget.cpp b/src/adblock/adblockwidget.cpp
index a5153f98..c5f09d5a 100644
--- a/src/adblock/adblockwidget.cpp
+++ b/src/adblock/adblockwidget.cpp
@@ -123,7 +123,7 @@ void AdBlockWidget::load()
const QStringList subscriptions = ReKonfig::subscriptionTitles();
// load automatic rules
- foreach(const QString & sub, subscriptions)
+ Q_FOREACH(const QString & sub, subscriptions)
{
QTreeWidgetItem *subItem = new QTreeWidgetItem(treeWidget);
subItem->setText(0, sub);
@@ -134,7 +134,7 @@ void AdBlockWidget::load()
KSharedConfig::Ptr config = KSharedConfig::openConfig("adblock", KConfig::SimpleConfig, "appdata");
KConfigGroup localGroup(config, "rules");
const QStringList rules = localGroup.readEntry("local-rules" , QStringList());
- foreach(const QString & rule, rules)
+ Q_FOREACH(const QString & rule, rules)
{
listWidget->addItem(rule);
}
@@ -149,7 +149,7 @@ void AdBlockWidget::loadRules(QTreeWidgetItem *item)
QString str = item->text(0) + "-rules";
QStringList rules = localGroup.readEntry(str , QStringList());
- foreach(const QString & rule, rules)
+ Q_FOREACH(const QString & rule, rules)
{
QTreeWidgetItem *subItem = new QTreeWidgetItem(item);
subItem->setText(0, rule);
diff --git a/src/adblock/adblockwidget.h b/src/adblock/adblockwidget.h
index daaf499e..aff8a007 100644
--- a/src/adblock/adblockwidget.h
+++ b/src/adblock/adblockwidget.h
@@ -45,13 +45,13 @@ public:
bool changed();
-signals:
+Q_SIGNALS:
void changed(bool);
-public slots:
+public Q_SLOTS:
void save();
-private slots:
+private Q_SLOTS:
void hasChanged();
void slotInfoLinkActivated(const QString &);