Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Daniel Foré
Epiphany
Commits
a7bd799a
Commit
a7bd799a
authored
May 21, 2018
by
Michael Catanzaro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add migrator to remove annoyance filters
https://bugzilla.gnome.org/show_bug.cgi?id=796245
parent
232c6134
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
2 deletions
+26
-2
lib/ephy-profile-utils.h
lib/ephy-profile-utils.h
+1
-1
src/profile-migrator/ephy-profile-migrator.c
src/profile-migrator/ephy-profile-migrator.c
+25
-1
No files found.
lib/ephy-profile-utils.h
View file @
a7bd799a
...
...
@@ -24,7 +24,7 @@
G_BEGIN_DECLS
#define EPHY_PROFILE_MIGRATION_VERSION 2
7
#define EPHY_PROFILE_MIGRATION_VERSION 2
8
#define EPHY_INSECURE_PASSWORDS_MIGRATION_VERSION 11
#define EPHY_SETTINGS_MIGRATION_VERSION 16
#define EPHY_FIREFOX_SYNC_PASSWORDS_MIGRATION_VERSION 19
...
...
src/profile-migrator/ephy-profile-migrator.c
View file @
a7bd799a
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment