diff options
author | Andrea Diamantini <adjam7@gmail.com> | 2010-03-13 23:24:45 +0100 |
---|---|---|
committer | Andrea Diamantini <adjam7@gmail.com> | 2010-03-13 23:24:45 +0100 |
commit | 6faa12680a0d7d2f13c2862628325ab65521004b (patch) | |
tree | d749f40b304feb6c1d007dcce46c9c8e9d17932d /src/adblock/adblockmanager.h | |
parent | Updating forgotten files (diff) | |
download | rekonq-6faa12680a0d7d2f13c2862628325ab65521004b.tar.xz |
Implemented automatic adblock update.
This (squashed) commit adds this new feature in rekonq, letting
people to simply "forgot" adblock and let rekonq do everything for it
I added:
- a new (rekonq) adblock widget
- an asyncronous method to update rules from the net every TOT days
- a better AdBlockManager management.
What it is actually missing is the adp protocol support to add new
subscriptions to adblock. This will come the next week.
For now this part seems stable and needs just testing :)
Diffstat (limited to 'src/adblock/adblockmanager.h')
-rw-r--r-- | src/adblock/adblockmanager.h | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/adblock/adblockmanager.h b/src/adblock/adblockmanager.h index d1bbe7ba..aac78e3b 100644 --- a/src/adblock/adblockmanager.h +++ b/src/adblock/adblockmanager.h @@ -112,6 +112,8 @@ #include <QObject> #include <QNetworkReply> #include <QStringList> +#include <QByteArray> +#include <KIO/Job> // Forward Includes class QNetworkRequest; @@ -129,9 +131,20 @@ public: AdBlockManager(QObject *parent = 0); ~AdBlockManager(); - void loadSettings(); QNetworkReply *block(const QNetworkRequest &request); void applyHidingRules(WebPage *page); + +public slots: + void loadSettings(); + +private: + void updateNextSubscription(); + void saveRules(const QStringList &); + void loadRules(const QStringList &); + +private slots: + void slotResult(KJob *); + void subscriptionData(KIO::Job*, const QByteArray&); private: bool _isAdblockEnabled; @@ -140,6 +153,9 @@ private: AdBlockRuleList _blackList; AdBlockRuleList _whiteList; QStringList _hideList; + + int _index; + QByteArray _buffer; }; #endif |