summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/adblock/adblockmanager.cpp22
-rw-r--r--src/adblock/adblockmanager.h3
-rw-r--r--src/protocolhandler.cpp53
-rw-r--r--src/protocolhandler.h1
4 files changed, 3 insertions, 76 deletions
diff --git a/src/adblock/adblockmanager.cpp b/src/adblock/adblockmanager.cpp
index 5078f215..e48cc753 100644
--- a/src/adblock/adblockmanager.cpp
+++ b/src/adblock/adblockmanager.cpp
@@ -64,7 +64,7 @@ AdBlockManager::~AdBlockManager()
}
-void AdBlockManager::loadSettings(bool checkUpdateDate)
+void AdBlockManager::loadSettings()
{
_index = 0;
_buffer.clear();
@@ -98,7 +98,7 @@ void AdBlockManager::loadSettings(bool checkUpdateDate)
QDateTime lastUpdate = ReKonfig::lastUpdate(); // the day of the implementation.. :)
int days = ReKonfig::updateInterval();
- if (!checkUpdateDate || today > lastUpdate.addDays(days))
+ if (today > lastUpdate.addDays(days))
{
ReKonfig::setLastUpdate(today);
@@ -346,24 +346,6 @@ void AdBlockManager::saveRules(const QStringList &rules)
}
-void AdBlockManager::addSubscription(const QString &title, const QString &location)
-{
- QStringList titles = ReKonfig::subscriptionTitles();
- if (titles.contains(title))
- return;
-
- QStringList locations = ReKonfig::subscriptionLocations();
- if (locations.contains(location))
- return;
-
- titles << title;
- locations << location;
-
- ReKonfig::setSubscriptionTitles(titles);
- ReKonfig::setSubscriptionLocations(locations);
-}
-
-
void AdBlockManager::showSettings()
{
QPointer<KDialog> dialog = new KDialog();
diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h
index 9d746e18..cce00877 100644
--- a/src/adblock/adblockmanager.h
+++ b/src/adblock/adblockmanager.h
@@ -155,10 +155,9 @@ public:
QNetworkReply *block(const QNetworkRequest &request, WebPage *page);
void applyHidingRules(WebPage *page);
- void addSubscription(const QString &title, const QString &location);
public Q_SLOTS:
- void loadSettings(bool checkUpdateDate = true);
+ void loadSettings();
void showSettings();
private:
diff --git a/src/protocolhandler.cpp b/src/protocolhandler.cpp
index bade99cb..4744e766 100644
--- a/src/protocolhandler.cpp
+++ b/src/protocolhandler.cpp
@@ -31,7 +31,6 @@
#include "rekonq.h"
// Local Includes
-#include "adblockmanager.h"
#include "application.h"
#include "historymanager.h"
#include "mainview.h"
@@ -124,13 +123,6 @@ bool ProtocolHandler::preHandling(const QNetworkRequest &request, QWebFrame *fra
return true;
}
- // "abp" handling
- if (_url.protocol() == QL1S("abp"))
- {
- abpHandling();
- return true;
- }
-
// "about" handling
if (_url.protocol() == QL1S("about"))
{
@@ -358,48 +350,3 @@ void ProtocolHandler::slotMostLocalUrlResult(KJob *job)
}
}
}
-
-
-/**
- * abp scheme (easy) explanation
- *
- */
-void ProtocolHandler::abpHandling()
-{
- QString path = _url.path();
- if (path != QL1S("subscribe"))
- return;
-
- QMap<QString, QString> map = _url.queryItems(KUrl::CaseInsensitiveKeys);
-
- QString location = map.value(QL1S("location"));
- QString title = map.value(QL1S("title"));
- QString requireslocation = map.value(QL1S("requireslocation"));
- QString requirestitle = map.value(QL1S("requirestitle"));
-
- QString info;
- if (requirestitle.isEmpty() || requireslocation.isEmpty())
- {
- info = title;
- }
- else
- {
- info = i18n("\n %1,\n %2 (required by %3)\n", title, requirestitle, title);
- }
-
- if (KMessageBox::questionYesNo(0,
- i18n("Do you want to add the following subscriptions to your adblock settings?\n") + info,
- i18n("Add automatic subscription to the adblock"),
- KGuiItem(i18n("Add")),
- KGuiItem(i18n("Discard"))
- )
- )
- {
- if (!requireslocation.isEmpty() && !requirestitle.isEmpty())
- {
- rApp->adblockManager()->addSubscription(requirestitle, requireslocation);
- }
- rApp->adblockManager()->addSubscription(title, location);
- rApp->adblockManager()->loadSettings(false);
- }
-}
diff --git a/src/protocolhandler.h b/src/protocolhandler.h
index 80f37dfc..bdc45534 100644
--- a/src/protocolhandler.h
+++ b/src/protocolhandler.h
@@ -74,7 +74,6 @@ private Q_SLOTS:
private:
QString dirHandling(const KFileItemList &list);
- void abpHandling();
KDirLister *_lister;
QWebFrame *_frame;