Commit a7bd799a authored by Michael Catanzaro's avatar Michael Catanzaro

Add migrator to remove annoyance filters

https://bugzilla.gnome.org/show_bug.cgi?id=796245
parent 232c6134
......@@ -24,7 +24,7 @@
G_BEGIN_DECLS
#define EPHY_PROFILE_MIGRATION_VERSION 27
#define EPHY_PROFILE_MIGRATION_VERSION 28
#define EPHY_INSECURE_PASSWORDS_MIGRATION_VERSION 11
#define EPHY_SETTINGS_MIGRATION_VERSION 16
#define EPHY_FIREFOX_SYNC_PASSWORDS_MIGRATION_VERSION 19
......
......@@ -30,6 +30,7 @@
#include "ephy-search-engine-manager.h"
#include "ephy-settings.h"
#include "ephy-sqlite-connection.h"
#include "ephy-string.h"
#include "ephy-sync-debug.h"
#include "ephy-sync-utils.h"
#include "ephy-uri-tester-shared.h"
......@@ -1192,6 +1193,28 @@ out:
g_list_free_full (passwords, g_object_unref);
}
static void
migrate_annoyance_list (void)
{
GVariant *user_value;
const char **filters;
char **modified_filters;
/* Has the filters setting been modified? If not, we're done. */
user_value = g_settings_get_user_value (EPHY_SETTINGS_MAIN, EPHY_PREFS_ADBLOCK_FILTERS);
if (!user_value)
return;
/* The annoyance list was causing a bunch of problems. Forcibly remove it. */
filters = g_variant_get_strv (user_value, NULL);
modified_filters = ephy_strv_remove (filters, "https://easylist.to/easylist/fanboy-annoyance.txt");
g_settings_set_strv (EPHY_SETTINGS_MAIN, EPHY_PREFS_ADBLOCK_FILTERS, (const char * const *)modified_filters);
g_variant_unref (user_value);
g_free (filters);
g_strfreev (modified_filters);
}
static void
migrate_nothing (void)
{
......@@ -1232,7 +1255,8 @@ const EphyProfileMigrator migrators[] = {
/* 24 */ migrate_bookmarks_timestamp,
/* 25 */ migrate_passwords_timestamp,
/* 26 */ migrate_nothing,
/* 27 */ migrate_search_engines
/* 27 */ migrate_search_engines,
/* 28 */ migrate_annoyance_list
};
static gboolean
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment