diff --git a/CHANGELOG b/CHANGELOG
index 73b6abacc..3e9ef709c 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ Version 1.5.0
* added support for Proxy Auto-Config (PAC)
* added option to open another private window from private window
* added delete action in edit context menu on page
+ * added possibility to remove EasyList from AdBlock
* proxy exceptions now supports wildcards (*, ?)
* cancel upload when trying to upload non-readable files
* GreaseMonkey: added support for GM_Settings
diff --git a/src/lib/adblock/adblockaddsubscriptiondialog.cpp b/src/lib/adblock/adblockaddsubscriptiondialog.cpp
index a41dee037..c6586b094 100644
--- a/src/lib/adblock/adblockaddsubscriptiondialog.cpp
+++ b/src/lib/adblock/adblockaddsubscriptiondialog.cpp
@@ -24,7 +24,8 @@ AdBlockAddSubscriptionDialog::AdBlockAddSubscriptionDialog(QWidget* parent)
{
ui->setupUi(this);
- m_knownSubscriptions << Subscription("Fanboy's List (English)", "http://www.fanboy.co.nz/adblock/fanboy-adblock.txt")
+ m_knownSubscriptions << Subscription("EasyList (English)", "https://easylist-downloads.adblockplus.org/easylist.txt")
+ << Subscription("Fanboy's List (English)", "http://www.fanboy.co.nz/adblock/fanboy-adblock.txt")
<< Subscription("Adversity (English)", "http://adversity.googlecode.com/hg/Adversity.txt")
<< Subscription("BSI Lista Polska (Polish)", "http://www.bsi.info.pl/filtrABP.txt")
<< Subscription("Czech List (Czech)", "http://adblock.dajbych.net/adblock.txt")
diff --git a/src/lib/adblock/adblockmanager.cpp b/src/lib/adblock/adblockmanager.cpp
index afe352f26..39f6ecfa8 100644
--- a/src/lib/adblock/adblockmanager.cpp
+++ b/src/lib/adblock/adblockmanager.cpp
@@ -225,7 +225,7 @@ void AdBlockManager::load()
}
foreach (const QString &fileName, adblockDir.entryList(QStringList("*.txt"), QDir::Files)) {
- if (fileName == QLatin1String("easylist.txt") || fileName == QLatin1String("customlist.txt")) {
+ if (fileName == QLatin1String("customlist.txt")) {
continue;
}
@@ -253,10 +253,15 @@ void AdBlockManager::load()
m_subscriptions.append(subscription);
}
- // Prepend EasyList
- AdBlockSubscription* easyList = new AdBlockEasyList(this);
- m_subscriptions.prepend(easyList);
- connect(easyList, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet()));
+ // Prepend EasyList if subscriptions are empty
+ if (m_subscriptions.isEmpty()) {
+ AdBlockSubscription* easyList = new AdBlockSubscription(tr("EasyList"), this);
+ easyList->setUrl(QUrl("https://easylist-downloads.adblockplus.org/easylist.txt"));
+ easyList->setFilePath(mApp->currentProfilePath() + "adblock/easylist.txt");
+ connect(easyList, SIGNAL(subscriptionUpdated()), mApp, SLOT(reloadUserStyleSheet()));
+
+ m_subscriptions.prepend(easyList);
+ }
// Append CustomList
AdBlockCustomList* customList = new AdBlockCustomList(this);
diff --git a/src/lib/adblock/adblocksubscription.cpp b/src/lib/adblock/adblocksubscription.cpp
index f69baf194..8ca3b4b24 100644
--- a/src/lib/adblock/adblocksubscription.cpp
+++ b/src/lib/adblock/adblocksubscription.cpp
@@ -181,6 +181,19 @@ void AdBlockSubscription::saveDownloadedData(const QByteArray &data)
return;
}
+ if (m_url == QUrl("https://easylist-downloads.adblockplus.org/easylist.txt")) {
+ // Third-party advertisers rules are with start domain (||) placeholder which needs regexps
+ // So we are ignoring it for keeping good performance
+ // But we will use whitelist rules at the end of list
+
+ QByteArray part1 = data.left(data.indexOf(QLatin1String("!-----------------------------Third-party adverts-----------------------------!")));
+ QByteArray part2 = data.mid(data.indexOf(QLatin1String("!---------------------------------Whitelists----------------------------------!")));
+
+ file.write(part1 + part2);
+ file.close();
+ return;
+ }
+
file.write(data);
file.close();
}
@@ -379,40 +392,6 @@ AdBlockSubscription::~AdBlockSubscription()
qDeleteAll(m_rules);
}
-// AdBlockEasyList
-
-AdBlockEasyList::AdBlockEasyList(QObject* parent)
- : AdBlockSubscription(tr("EasyList"), parent)
-{
- setUrl(QUrl("https://easylist-downloads.adblockplus.org/easylist.txt"));
- setFilePath(mApp->currentProfilePath() + "adblock/easylist.txt");
-}
-
-bool AdBlockEasyList::canBeRemoved() const
-{
- return false;
-}
-
-void AdBlockEasyList::saveDownloadedData(const QByteArray &data)
-{
- QFile file(filePath());
-
- if (!file.open(QFile::ReadWrite | QFile::Truncate)) {
- qWarning() << "AdBlockSubscription::" << __FUNCTION__ << "Unable to open adblock file for writing:" << filePath();
- return;
- }
-
- // Third-party advertisers rules are with start domain (||) placeholder which needs regexps
- // So we are ignoring it for keeping good performance
- // But we will use whitelist rules at the end of list
-
- QByteArray part1 = data.left(data.indexOf(QLatin1String("!-----------------------------Third-party adverts-----------------------------!")));
- QByteArray part2 = data.mid(data.indexOf(QLatin1String("!---------------------------------Whitelists----------------------------------!")));
-
- file.write(part1 + part2);
- file.close();
-}
-
// AdBlockCustomList
AdBlockCustomList::AdBlockCustomList(QObject* parent)
diff --git a/src/lib/adblock/adblocksubscription.h b/src/lib/adblock/adblocksubscription.h
index 94065af38..a83ffd151 100644
--- a/src/lib/adblock/adblocksubscription.h
+++ b/src/lib/adblock/adblocksubscription.h
@@ -131,18 +131,6 @@ private:
bool m_updated;
};
-class AdBlockEasyList : public AdBlockSubscription
-{
- Q_OBJECT
-public:
- explicit AdBlockEasyList(QObject* parent = 0);
-
- bool canBeRemoved() const;
-
-protected:
- void saveDownloadedData(const QByteArray &data);
-};
-
class AdBlockCustomList : public AdBlockSubscription
{
Q_OBJECT
diff --git a/translations/empty.ts b/translations/empty.ts
index 2dbe4da4c..f4b1478a1 100644
--- a/translations/empty.ts
+++ b/translations/empty.ts
@@ -116,7 +116,7 @@
AdBlockCustomList
-
+
@@ -179,14 +179,6 @@
-
- AdBlockEasyList
-
-
-
-
-
-
AdBlockIcon
@@ -258,6 +250,11 @@
+
+
+
+
+
AdBlockTreeWidget
@@ -2439,12 +2436,12 @@
-
+
-
+
@@ -5751,173 +5748,173 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla
WebPage
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -5963,268 +5960,268 @@ After adding or removing certificate paths, it is neccessary to restart QupZilla
-
+
-
+
-
+
-
+
-
+
-
-
+
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+