[epiphany/wip/tingping/profile-migration: 101/105] Rename ephy_dot_dir() to ephy_profile_dir()
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/tingping/profile-migration: 101/105] Rename ephy_dot_dir() to ephy_profile_dir()
- Date: Thu, 31 Jan 2019 22:31:04 +0000 (UTC)
commit f44e87ec548d7efad27b67b7327f3d0d17ebd168
Author: Patrick Griffis <pgriffis igalia com>
Date: Mon Dec 24 09:07:18 2018 -0500
Rename ephy_dot_dir() to ephy_profile_dir()
This just more accurately reflects what it actually is.
embed/ephy-embed-prefs.c | 2 +-
embed/ephy-embed-shell.c | 29 +++-------
embed/web-extension/ephy-web-extension.c | 2 +-
lib/ephy-file-helpers.c | 85 ++++++++++++++--------------
lib/ephy-file-helpers.h | 8 +--
lib/ephy-permissions-manager.c | 4 +-
lib/ephy-profile-utils.c | 10 ++--
lib/ephy-settings.c | 12 ++--
lib/ephy-web-app-utils.c | 4 +-
src/bookmarks/ephy-bookmarks-manager.c | 2 +-
src/ephy-main.c | 2 +-
src/ephy-session.c | 2 +-
src/ephy-window.c | 2 +-
src/prefs-dialog.c | 4 +-
src/profile-migrator/ephy-profile-migrator.c | 72 +----------------------
src/search-provider/ephy-search-provider.c | 2 +-
tests/ephy-file-helpers-test.c | 4 +-
tests/ephy-web-app-utils-test.c | 6 +-
18 files changed, 86 insertions(+), 166 deletions(-)
---
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c
index ae4ab843e..a3cd389d5 100644
--- a/embed/ephy-embed-prefs.c
+++ b/embed/ephy-embed-prefs.c
@@ -117,7 +117,7 @@ webkit_pref_callback_user_stylesheet (GSettings *settings,
GError *error = NULL;
char *filename;
- filename = g_build_filename (ephy_dot_dir (), USER_STYLESHEET_FILENAME, NULL);
+ filename = g_build_filename (ephy_profile_dir (), USER_STYLESHEET_FILENAME, NULL);
file = g_file_new_for_path (filename);
g_free (filename);
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 546e22952..4bcb8d01e 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -770,7 +770,7 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
else
mode = EPHY_SQLITE_CONNECTION_MODE_READWRITE;
- filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
+ filename = g_build_filename (ephy_profile_dir (), EPHY_HISTORY_FILE, NULL);
priv->global_history_service = ephy_history_service_new (filename, mode);
g_free (filename);
g_assert (priv->global_history_service);
@@ -969,7 +969,7 @@ initialize_web_extensions (WebKitWebContext *web_context,
user_data = g_variant_new ("(smsssbb)",
priv->guid,
address,
- ephy_dot_dir (),
+ ephy_profile_dir (),
ephy_filters_manager_get_adblock_filters_dir (priv->filters_manager),
private_profile,
browser_mode);
@@ -1072,8 +1072,6 @@ ephy_embed_shell_create_web_context (EphyEmbedShell *shell)
{
EphyEmbedShellPrivate *priv = ephy_embed_shell_get_instance_private (shell);
WebKitWebsiteDataManager *manager;
- char *data_dir;
- char *cache_dir;
if (priv->mode == EPHY_EMBED_SHELL_MODE_INCOGNITO) {
priv->web_context = webkit_web_context_new_ephemeral ();
@@ -1086,18 +1084,9 @@ ephy_embed_shell_create_web_context (EphyEmbedShell *shell)
return;
}
- data_dir = g_build_filename (priv->mode == EPHY_EMBED_SHELL_MODE_PRIVATE ?
- ephy_dot_dir () : g_get_user_data_dir (),
- g_get_prgname (), NULL);
- cache_dir = g_build_filename (priv->mode == EPHY_EMBED_SHELL_MODE_PRIVATE ?
- ephy_dot_dir () : g_get_user_cache_dir (),
- g_get_prgname (), NULL);
-
- manager = webkit_website_data_manager_new ("base-data-directory", data_dir,
- "base-cache-directory", cache_dir,
+ manager = webkit_website_data_manager_new ("base-data-directory", ephy_profile_dir (),
+ "base-cache-directory", ephy_cache_dir (),
NULL);
- g_free (data_dir);
- g_free (cache_dir);
priv->web_context = webkit_web_context_new_with_website_data_manager (manager);
g_object_unref (manager);
@@ -1276,7 +1265,7 @@ ephy_embed_shell_startup (GApplication *application)
/* Store cookies in moz-compatible SQLite format */
cookie_manager = webkit_web_context_get_cookie_manager (priv->web_context);
if (!webkit_web_context_is_ephemeral (priv->web_context)) {
- filename = g_build_filename (ephy_dot_dir (), "cookies.sqlite", NULL);
+ filename = g_build_filename (ephy_profile_dir (), "cookies.sqlite", NULL);
webkit_cookie_manager_set_persistent_storage (cookie_manager, filename,
WEBKIT_COOKIE_PERSISTENT_STORAGE_SQLITE);
g_free (filename);
@@ -1558,7 +1547,7 @@ ephy_embed_shell_set_page_setup (EphyEmbedShell *shell,
priv->page_setup = page_setup;
- path = g_build_filename (ephy_dot_dir (), PAGE_SETUP_FILENAME, NULL);
+ path = g_build_filename (ephy_profile_dir (), PAGE_SETUP_FILENAME, NULL);
gtk_page_setup_to_file (page_setup, path, NULL);
g_free (path);
}
@@ -1579,7 +1568,7 @@ ephy_embed_shell_get_page_setup (EphyEmbedShell *shell)
GError *error = NULL;
char *path;
- path = g_build_filename (ephy_dot_dir (), PAGE_SETUP_FILENAME, NULL);
+ path = g_build_filename (ephy_profile_dir (), PAGE_SETUP_FILENAME, NULL);
priv->page_setup = gtk_page_setup_new_from_file (path, &error);
g_free (path);
@@ -1619,7 +1608,7 @@ ephy_embed_shell_set_print_settings (EphyEmbedShell *shell,
priv->print_settings = settings ? settings : gtk_print_settings_new ();
- path = g_build_filename (ephy_dot_dir (), PRINT_SETTINGS_FILENAME, NULL);
+ path = g_build_filename (ephy_profile_dir (), PRINT_SETTINGS_FILENAME, NULL);
gtk_print_settings_to_file (settings, path, NULL);
g_free (path);
}
@@ -1643,7 +1632,7 @@ ephy_embed_shell_get_print_settings (EphyEmbedShell *shell)
GError *error = NULL;
char *path;
- path = g_build_filename (ephy_dot_dir (), PRINT_SETTINGS_FILENAME, NULL);
+ path = g_build_filename (ephy_profile_dir (), PRINT_SETTINGS_FILENAME, NULL);
priv->print_settings = gtk_print_settings_new_from_file (path, &error);
g_free (path);
diff --git a/embed/web-extension/ephy-web-extension.c b/embed/web-extension/ephy-web-extension.c
index df060f43a..f059c207b 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -770,7 +770,7 @@ window_object_cleared_cb (WebKitScriptWorld *world,
js_function = jsc_value_new_function (js_context,
"isWebApplication",
- G_CALLBACK (ephy_dot_dir_is_web_application), NULL, NULL,
+ G_CALLBACK (ephy_profile_dir_is_web_application), NULL, NULL,
G_TYPE_BOOLEAN, 0,
G_TYPE_NONE);
jsc_value_object_set_property (js_ephy, "isWebApplication", js_function);
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 68870541f..184e963b2 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -68,10 +68,10 @@ static GHashTable *files;
static GHashTable *mime_table;
static gboolean keep_directory;
-static char *dot_dir;
+static char *profile_dir_global;
static char *cache_dir;
static char *tmp_dir;
-static EphyProfileDirType dot_dir_type;
+static EphyProfileDirType profile_dir_type;
GQuark ephy_file_helpers_error_quark;
@@ -218,17 +218,17 @@ ephy_file_tmp_filename (const char *base,
}
/**
- * ephy_dot_dir:
+ * ephy_profile_dir:
*
- * Gets Epiphany's configuration directory, usually .config/epiphany
+ * Gets Epiphany's configuration directory, usually .local/share/epiphany
* under user's homedir.
*
* Returns: the full path to Epiphany's configuration directory
**/
const char *
-ephy_dot_dir (void)
+ephy_profile_dir (void)
{
- return dot_dir;
+ return profile_dir_global;
}
/**
@@ -247,44 +247,44 @@ ephy_cache_dir (void)
/**
- * ephy_dot_dir_is_default:
+ * ephy_profile_dir_is_default:
*
- * Returns whether the dot directory in use is the default one, found in
- * ~/.config
+ * Returns whether the profile directory in use is the default one, found in
+ * ~/.local/share
*
- * Returns: %TRUE if it is the default dot dir, %FALSE for others
+ * Returns: %TRUE if it is the default profile dir, %FALSE for others
**/
gboolean
-ephy_dot_dir_is_default (void)
+ephy_profile_dir_is_default (void)
{
- return dot_dir_type == EPHY_PROFILE_DIR_DEFAULT || dot_dir_type == EPHY_PROFILE_DIR_TEST;
+ return profile_dir_type == EPHY_PROFILE_DIR_DEFAULT || profile_dir_type == EPHY_PROFILE_DIR_TEST;
}
/**
- * ephy_dot_dir_is_web_application:
+ * ephy_profile_dir_is_web_application:
*
- * Returns whether the dot directory in use is a web appplication one.
+ * Returns whether the profile directory in use is a web appplication one.
*
- * Returns: %TRUE if it is a web application dot dir, %FALSE for others
+ * Returns: %TRUE if it is a web application profile dir, %FALSE for others
*/
gboolean
-ephy_dot_dir_is_web_application (void)
+ephy_profile_dir_is_web_application (void)
{
- return dot_dir_type == EPHY_PROFILE_DIR_WEB_APP;
+ return profile_dir_type == EPHY_PROFILE_DIR_WEB_APP;
}
/**
- * ephy_default_dot_dir:
+ * ephy_default_profile_dir:
*
- * Get the path to the default dot directory found in ~/.config
+ * Get the path to the default profile directory found in ~/.local/share
*
* Returns: a new allocated string, free with g_free() when done.
*/
char *
-ephy_default_dot_dir (void)
+ephy_default_profile_dir (void)
{
- return dot_dir_type == EPHY_PROFILE_DIR_TEST ?
- g_strdup (ephy_dot_dir ()) :
+ return profile_dir_type == EPHY_PROFILE_DIR_TEST ?
+ g_strdup (ephy_profile_dir ()) :
g_build_filename (g_get_user_data_dir (), "epiphany", NULL);
}
@@ -298,8 +298,8 @@ ephy_default_dot_dir (void)
char *
ephy_default_cache_dir (void)
{
- return dot_dir_type == EPHY_PROFILE_DIR_TEST ?
- g_build_filename (ephy_dot_dir (), "cache", NULL) :
+ return profile_dir_type == EPHY_PROFILE_DIR_TEST ?
+ g_build_filename (ephy_profile_dir (), "cache", NULL) :
g_build_filename (g_get_user_cache_dir (), "epiphany", NULL);
}
@@ -336,18 +336,18 @@ ephy_file_helpers_init (const char *profile_dir,
if (profile_dir != NULL && !steal_data_from_profile) {
if (g_path_is_absolute (profile_dir)) {
- dot_dir = g_strdup (profile_dir);
+ profile_dir_global = g_strdup (profile_dir);
} else {
GFile *file = g_file_new_for_path (profile_dir);
- dot_dir = g_file_get_path (file);
+ profile_dir_global = g_file_get_path (file);
g_object_unref (file);
}
g_autofree char *app_file = g_build_filename (profile_dir, ".app", NULL);
if (g_file_test (app_file, G_FILE_TEST_EXISTS)) {
- const char *app_name = ephy_web_application_get_program_name_from_profile_directory (dot_dir);
+ const char *app_name = ephy_web_application_get_program_name_from_profile_directory
(profile_dir_global);
cache_dir = g_build_filename (g_get_user_cache_dir (), app_name, NULL);
- dot_dir_type = EPHY_PROFILE_DIR_WEB_APP;
+ profile_dir_type = EPHY_PROFILE_DIR_WEB_APP;
}
} else if (private_profile) {
if (ephy_file_tmp_dir () == NULL) {
@@ -359,28 +359,27 @@ ephy_file_helpers_init (const char *profile_dir,
return FALSE;
}
- dot_dir = g_build_filename (ephy_file_tmp_dir (),
- "epiphany",
- NULL);
- cache_dir = g_build_filename (dot_dir, "cache", NULL);
+ profile_dir_global = g_build_filename (ephy_file_tmp_dir (),
+ "epiphany",
+ NULL);
+ cache_dir = g_build_filename (profile_dir_global, "cache", NULL);
if (flags & EPHY_FILE_HELPERS_TESTING_MODE)
- dot_dir_type = EPHY_PROFILE_DIR_TEST;
+ profile_dir_type = EPHY_PROFILE_DIR_TEST;
}
- if (dot_dir == NULL) {
- dot_dir_type = EPHY_PROFILE_DIR_DEFAULT;
- dot_dir = ephy_default_dot_dir ();
+ if (profile_dir_global == NULL) {
+ profile_dir_type = EPHY_PROFILE_DIR_DEFAULT;
+ profile_dir_global = ephy_default_profile_dir ();
}
if (cache_dir == NULL)
cache_dir = ephy_default_cache_dir ();
if (flags & EPHY_FILE_HELPERS_ENSURE_EXISTS) {
- ret = ephy_ensure_dir_exists (ephy_dot_dir (), error);
+ ret = ephy_ensure_dir_exists (ephy_profile_dir (), error);
ephy_ensure_dir_exists (ephy_cache_dir (), NULL);
}
-
if (steal_data_from_profile && profile_dir) {
guint i;
const char *files_to_copy[] = { EPHY_HISTORY_FILE, EPHY_BOOKMARKS_FILE };
@@ -396,7 +395,7 @@ ephy_file_helpers_init (const char *profile_dir,
source = g_file_new_for_path (filename);
g_free (filename);
- filename = g_build_filename (dot_dir,
+ filename = g_build_filename (profile_dir_global,
files_to_copy[i],
NULL);
destination = g_file_new_for_path (filename);
@@ -434,9 +433,7 @@ ephy_file_helpers_shutdown (void)
mime_table = NULL;
}
- g_free (dot_dir);
- dot_dir = NULL;
-
+ g_clear_pointer (&profile_dir_global, g_free);
g_clear_pointer (&cache_dir, g_free);
if (tmp_dir != NULL) {
@@ -480,7 +477,7 @@ ephy_ensure_dir_exists (const char *dir,
if (!g_file_test (dir, G_FILE_TEST_EXISTS)) {
if (g_mkdir_with_parents (dir, 488) == 0) {
- if (dir == ephy_dot_dir ()) {
+ if (dir == ephy_profile_dir ()) {
/* We need to set the .migrated file to the
* current profile migration version,
* otherwise the next time the browser runs
@@ -789,7 +786,7 @@ ephy_open_incognito_window (const char *uri)
char *command;
GError *error = NULL;
- command = g_strdup_printf ("epiphany --incognito-mode --profile %s ", ephy_dot_dir ());
+ command = g_strdup_printf ("epiphany --incognito-mode --profile %s ", ephy_profile_dir ());
if (uri) {
char *str = g_strconcat (command, uri, NULL);
diff --git a/lib/ephy-file-helpers.h b/lib/ephy-file-helpers.h
index bb861c1ba..f5373a6d5 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -56,11 +56,11 @@ typedef enum
gboolean ephy_file_helpers_init (const char *profile_dir,
EphyFileHelpersFlags flags,
GError **error);
-const char * ephy_dot_dir (void);
-gboolean ephy_dot_dir_is_default (void);
-gboolean ephy_dot_dir_is_web_application (void);
+const char * ephy_profile_dir (void);
+gboolean ephy_profile_dir_is_default (void);
+gboolean ephy_profile_dir_is_web_application (void);
const char * ephy_cache_dir (void);
-char * ephy_default_dot_dir (void);
+char * ephy_default_profile_dir (void);
char * ephy_default_cache_dir (void);
void ephy_file_helpers_shutdown (void);
char * ephy_file_get_downloads_dir (void);
diff --git a/lib/ephy-permissions-manager.c b/lib/ephy-permissions-manager.c
index 375162652..7b0e77557 100644
--- a/lib/ephy-permissions-manager.c
+++ b/lib/ephy-permissions-manager.c
@@ -115,7 +115,7 @@ ephy_permissions_manager_get_settings_for_origin (EphyPermissionsManager *manage
if (settings)
return settings;
- filename = g_build_filename (ephy_dot_dir (), PERMISSIONS_FILENAME, NULL);
+ filename = g_build_filename (ephy_profile_dir (), PERMISSIONS_FILENAME, NULL);
backend = g_keyfile_settings_backend_new (filename, "/", NULL);
g_free (filename);
@@ -373,7 +373,7 @@ ephy_permissions_manager_get_matching_origins (EphyPermissionsManager *manager,
/* Not cached. Load results from GSettings keyfile. Do it manually because the
* GSettings API is not designed to be used for enumerating settings. */
file = g_key_file_new ();
- filename = g_build_filename (ephy_dot_dir (), PERMISSIONS_FILENAME, NULL);
+ filename = g_build_filename (ephy_profile_dir (), PERMISSIONS_FILENAME, NULL);
g_key_file_load_from_file (file, filename, G_KEY_FILE_NONE, &error);
if (error != NULL) {
diff --git a/lib/ephy-profile-utils.c b/lib/ephy-profile-utils.c
index 4dc11b5a9..54a9344ff 100644
--- a/lib/ephy-profile-utils.c
+++ b/lib/ephy-profile-utils.c
@@ -50,8 +50,8 @@ ephy_profile_utils_get_migration_version_for_profile_dir (const char *profile_di
if (result != 1)
latest = 0;
- } else if (strcmp (ephy_dot_dir (), profile_directory) == 0 &&
- ephy_dot_dir_is_default () == FALSE) {
+ } else if (strcmp (ephy_profile_dir (), profile_directory) == 0 &&
+ ephy_profile_dir_is_default () == FALSE) {
/* Since version 8, we need to migrate also profile directories
other than the default one. Profiles in such directories work
perfectly fine without going through the first 7 migration
@@ -69,7 +69,7 @@ ephy_profile_utils_get_migration_version_for_profile_dir (const char *profile_di
int
ephy_profile_utils_get_migration_version (void)
{
- return ephy_profile_utils_get_migration_version_for_profile_dir (ephy_dot_dir ());
+ return ephy_profile_utils_get_migration_version_for_profile_dir (ephy_profile_dir ());
}
gboolean
@@ -78,7 +78,7 @@ ephy_profile_utils_set_migration_version (int version)
char *migrated_file, *contents;
gboolean result = FALSE;
- migrated_file = g_build_filename (ephy_dot_dir (),
+ migrated_file = g_build_filename (ephy_profile_dir (),
PROFILE_MIGRATION_FILE,
NULL);
contents = g_strdup_printf ("%d", version);
@@ -86,7 +86,7 @@ ephy_profile_utils_set_migration_version (int version)
if (result == FALSE)
LOG ("Couldn't store migration version %d in %s (%s, %s)",
- version, migrated_file, ephy_dot_dir (), PROFILE_MIGRATION_FILE);
+ version, migrated_file, ephy_profile_dir (), PROFILE_MIGRATION_FILE);
g_free (contents);
g_free (migrated_file);
diff --git a/lib/ephy-settings.c b/lib/ephy-settings.c
index 0082caea1..16f5d72bc 100644
--- a/lib/ephy-settings.c
+++ b/lib/ephy-settings.c
@@ -42,7 +42,7 @@ ephy_settings_init (void)
if (settings != NULL)
return;
- profile_directory = ephy_dot_dir ();
+ profile_directory = ephy_profile_dir ();
if (!profile_directory)
g_error ("ephy-settings used before ephy_file_helpers_init");
@@ -50,7 +50,7 @@ ephy_settings_init (void)
g_str_equal, g_free,
g_object_unref);
- if (ephy_dot_dir_is_web_application ()) {
+ if (ephy_profile_dir_is_web_application ()) {
const char *web_app_name = ephy_web_application_get_program_name_from_profile_directory
(profile_directory);
base_path = g_build_path ("/", "/org/gnome/epiphany/web-apps/", web_app_name, NULL);
} else {
@@ -60,7 +60,7 @@ ephy_settings_init (void)
for (guint i = 0; i < G_N_ELEMENTS (ephy_prefs_relocatable_schemas); i++) {
char *path;
- if (!ephy_dot_dir_is_web_application () && ephy_prefs_relocatable_schemas[i].is_webapp_only)
+ if (!ephy_profile_dir_is_web_application () && ephy_prefs_relocatable_schemas[i].is_webapp_only)
continue;
path = g_build_path ("/", base_path, ephy_prefs_relocatable_schemas[i].path, NULL);
@@ -144,8 +144,8 @@ get_relocatable_path (const char *schema)
{
g_autofree char *base_path = NULL;
- if (ephy_dot_dir_is_web_application ()) {
- const char *web_app_name = ephy_web_application_get_program_name_from_profile_directory (ephy_dot_dir
());
+ if (ephy_profile_dir_is_web_application ()) {
+ const char *web_app_name = ephy_web_application_get_program_name_from_profile_directory
(ephy_profile_dir ());
base_path = g_build_path ("/", "/org/gnome/epiphany/web-apps/", web_app_name, NULL);
} else
base_path = g_strdup ("/org/gnome/epiphany/");
@@ -195,7 +195,7 @@ ephy_settings_get_for_web_extension (const char *schema)
return gsettings;
}
- g_autofree char *keyfile_path = g_build_filename (ephy_dot_dir (), "web-extension-settings.ini", NULL);
+ g_autofree char *keyfile_path = g_build_filename (ephy_profile_dir (), "web-extension-settings.ini",
NULL);
backend = g_keyfile_settings_backend_new (keyfile_path, "/", "/");
GSettings *web_gsettings;
diff --git a/lib/ephy-web-app-utils.c b/lib/ephy-web-app-utils.c
index e0dbd050b..da0957162 100644
--- a/lib/ephy-web-app-utils.c
+++ b/lib/ephy-web-app-utils.c
@@ -160,7 +160,7 @@ ephy_web_application_get_profile_directory (const char *id)
if (!app_dir)
return NULL;
- dot_dir = !ephy_dot_dir_is_default () ? ephy_default_dot_dir () : NULL;
+ dot_dir = !ephy_profile_dir_is_default () ? ephy_default_profile_dir () : NULL;
profile_dir = g_build_filename (dot_dir ? dot_dir : g_get_user_data_dir (), app_dir, NULL);
g_free (app_dir);
g_free (dot_dir);
@@ -544,7 +544,7 @@ ephy_web_application_get_application_list_internal (gboolean only_legacy)
char *default_dot_dir;
g_autofree char *profile_base = NULL;
- default_dot_dir = !ephy_dot_dir_is_default () ? ephy_default_dot_dir () : NULL;
+ default_dot_dir = !ephy_profile_dir_is_default () ? ephy_default_profile_dir () : NULL;
if (only_legacy) {
profile_base = g_build_filename (g_get_user_config_dir (), "epiphany", NULL);
dot_dir = g_file_new_for_path (profile_base);
diff --git a/src/bookmarks/ephy-bookmarks-manager.c b/src/bookmarks/ephy-bookmarks-manager.c
index 8b5202a38..4860997f2 100644
--- a/src/bookmarks/ephy-bookmarks-manager.c
+++ b/src/bookmarks/ephy-bookmarks-manager.c
@@ -205,7 +205,7 @@ ephy_bookmarks_manager_class_init (EphyBookmarksManagerClass *klass)
static void
ephy_bookmarks_manager_init (EphyBookmarksManager *self)
{
- self->gvdb_filename = g_build_filename (ephy_dot_dir (),
+ self->gvdb_filename = g_build_filename (ephy_profile_dir (),
EPHY_BOOKMARKS_FILE,
NULL);
diff --git a/src/ephy-main.c b/src/ephy-main.c
index 877952075..04ed3fe12 100644
--- a/src/ephy-main.c
+++ b/src/ephy-main.c
@@ -316,7 +316,7 @@ main (int argc,
}
if (incognito_mode && profile_directory == NULL)
- profile_directory = ephy_default_dot_dir ();
+ profile_directory = ephy_default_profile_dir ();
/* Start our services */
flags = !application_mode ? EPHY_FILE_HELPERS_ENSURE_EXISTS : 0;
diff --git a/src/ephy-session.c b/src/ephy-session.c
index 4b908c0de..b8253276d 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -94,7 +94,7 @@ get_session_file (const char *filename)
}
if (strcmp (filename, SESSION_STATE) == 0) {
- path = g_build_filename (ephy_dot_dir (),
+ path = g_build_filename (ephy_profile_dir (),
"session_state.xml",
NULL);
} else {
diff --git a/src/ephy-window.c b/src/ephy-window.c
index c6065e4cf..5d7bb72e8 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3167,7 +3167,7 @@ ephy_window_should_save_state (EphyWindow *window)
if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION)
return TRUE;
- return ephy_dot_dir_is_default ();
+ return ephy_profile_dir_is_default ();
}
static void
diff --git a/src/prefs-dialog.c b/src/prefs-dialog.c
index eb954e729..1fe3cc726 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1111,7 +1111,7 @@ css_edit_button_clicked_cb (GtkWidget *button,
{
GFile *css_file;
- css_file = g_file_new_for_path (g_build_filename (ephy_dot_dir (),
+ css_file = g_file_new_for_path (g_build_filename (ephy_profile_dir (),
USER_STYLESHEET_FILENAME,
NULL));
@@ -1925,7 +1925,7 @@ setup_general_page (PrefsDialog *dialog)
GSettings *web_settings;
if (ephy_embed_shell_get_mode (ephy_embed_shell_get_default ()) == EPHY_EMBED_SHELL_MODE_APPLICATION) {
- dialog->webapp = ephy_web_application_for_profile_directory (ephy_dot_dir ());
+ dialog->webapp = ephy_web_application_for_profile_directory (ephy_profile_dir ());
prefs_dialog_update_webapp_icon (dialog, dialog->webapp->icon_url);
gtk_entry_set_text (GTK_ENTRY (dialog->webapp_url), dialog->webapp->url);
gtk_entry_set_text (GTK_ENTRY (dialog->webapp_title), dialog->webapp->name);
diff --git a/src/profile-migrator/ephy-profile-migrator.c b/src/profile-migrator/ephy-profile-migrator.c
index 5db46c7e7..817e656b0 100644
--- a/src/profile-migrator/ephy-profile-migrator.c
+++ b/src/profile-migrator/ephy-profile-migrator.c
@@ -100,7 +100,7 @@ typedef void (*EphyProfileMigrator) (void);
static gboolean
profile_dir_exists (void)
{
- if (g_file_test (ephy_dot_dir (), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
+ if (g_file_test (ephy_profile_dir (), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
return TRUE;
if (g_file_test (legacy_profile_dir (), G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR))
@@ -772,72 +772,6 @@ out:
g_list_free_full (passwords, g_object_unref);
}
-<<<<<<< HEAD
-=======
-static const char * const old_sync_settings[] = {
- EPHY_PREFS_SYNC_USER,
- EPHY_PREFS_SYNC_TIME,
- EPHY_PREFS_SYNC_DEVICE_ID,
- EPHY_PREFS_SYNC_DEVICE_NAME,
- EPHY_PREFS_SYNC_FREQUENCY,
- EPHY_PREFS_SYNC_WITH_FIREFOX,
- EPHY_PREFS_SYNC_BOOKMARKS_ENABLED,
- EPHY_PREFS_SYNC_BOOKMARKS_TIME,
- EPHY_PREFS_SYNC_BOOKMARKS_INITIAL,
- EPHY_PREFS_SYNC_PASSWORDS_ENABLED,
- EPHY_PREFS_SYNC_PASSWORDS_TIME,
- EPHY_PREFS_SYNC_PASSWORDS_INITIAL,
- EPHY_PREFS_SYNC_HISTORY_ENABLED,
- EPHY_PREFS_SYNC_HISTORY_TIME,
- EPHY_PREFS_SYNC_HISTORY_INITIAL,
- EPHY_PREFS_SYNC_OPEN_TABS_ENABLED,
- EPHY_PREFS_SYNC_OPEN_TABS_TIME
-};
-
-static void
-migrate_sync_settings_path (void)
-{
- GSettings *deprecated_settings = ephy_settings_get ("org.gnome.Epiphany.sync.DEPRECATED");
-
- /* Sync settings are only used in browser mode, so no need to migrate if we
- * are not in browser mode. */
- if (!legacy_dir_is_default ())
- return;
-
- for (guint i = 0; i < G_N_ELEMENTS (old_sync_settings); i++) {
- GVariant *user_value;
-
- /* Has the setting been changed from its default? */
- user_value = g_settings_get_user_value (deprecated_settings, old_sync_settings[i]);
-
- if (user_value != NULL) {
- GVariant *value;
- const GVariantType *type;
-
- value = g_settings_get_value (deprecated_settings, old_sync_settings[i]);
- type = g_variant_get_type (value);
-
- /* All double values in the old sync schema have been converted to gint64 in the new schema. */
- if (g_variant_type_equal (type, G_VARIANT_TYPE_DOUBLE)) {
- g_settings_set_value (EPHY_SETTINGS_SYNC, old_sync_settings[i],
- g_variant_new_int64 (ceil (g_variant_get_double (value))));
- } else {
- g_settings_set_value (EPHY_SETTINGS_SYNC, old_sync_settings[i], value);
- }
-
- /* We do not want to ever run this migration again, to avoid writing old
- * values over new ones. So be cautious and reset the old settings. */
- g_settings_reset (deprecated_settings, old_sync_settings[i]);
-
- g_variant_unref (value);
- g_variant_unref (user_value);
- }
- }
-
- g_settings_sync ();
-}
-
->>>>>>> Move profile directories to data dir
static void
migrate_sync_device_info (void)
{
@@ -1223,7 +1157,7 @@ migrate_profile_directories (void)
/* The default profile also changed directories */
g_autoptr(GFile) old_directory = g_file_new_for_path (legacy_default_profile_dir ());
- g_autoptr(GFile) new_directory = g_file_new_for_path (ephy_default_dot_dir ());
+ g_autoptr(GFile) new_directory = g_file_new_for_path (ephy_default_profile_dir ());
if (!move_directory_contents (old_directory, new_directory))
return;
@@ -1257,7 +1191,7 @@ migrate_zoom_level (void)
char *history_filename;
const char *sql_query;
- history_filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
+ history_filename = g_build_filename (ephy_profile_dir (), EPHY_HISTORY_FILE, NULL);
if (!g_file_test (history_filename, G_FILE_TEST_EXISTS)) {
LOG ("There is no history to migrate...");
goto out;
diff --git a/src/search-provider/ephy-search-provider.c b/src/search-provider/ephy-search-provider.c
index 2742dfd9a..e7422e640 100644
--- a/src/search-provider/ephy-search-provider.c
+++ b/src/search-provider/ephy-search-provider.c
@@ -339,7 +339,7 @@ ephy_search_provider_init (EphySearchProvider *self)
self->settings = g_settings_new (EPHY_PREFS_SCHEMA);
- filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
+ filename = g_build_filename (ephy_profile_dir (), EPHY_HISTORY_FILE, NULL);
self->bookmarks_manager = ephy_bookmarks_manager_new ();
self->model = ephy_suggestion_model_new (ephy_embed_shell_get_global_history_service (shell),
self->bookmarks_manager);
diff --git a/tests/ephy-file-helpers-test.c b/tests/ephy-file-helpers-test.c
index 389ae1cf4..f6affd467 100644
--- a/tests/ephy-file-helpers-test.c
+++ b/tests/ephy-file-helpers-test.c
@@ -65,11 +65,11 @@ test_ephy_file_helpers_init (void)
keep_dir ? "TRUE" : "FALSE",
ensure_exists ? "TRUE" : "FALSE");
- g_assert_null (ephy_dot_dir ());
+ g_assert_null (ephy_profile_dir ());
g_assert_true (ephy_file_helpers_init (NULL, test.flags, NULL));
tmp_dir = g_strdup (ephy_file_tmp_dir ());
- dot_dir = g_strdup (ephy_dot_dir ());
+ dot_dir = g_strdup (ephy_profile_dir ());
g_assert_nonnull (tmp_dir);
g_assert_nonnull (dot_dir);
diff --git a/tests/ephy-web-app-utils-test.c b/tests/ephy-web-app-utils-test.c
index da47b0ce0..6e45c358c 100644
--- a/tests/ephy-web-app-utils-test.c
+++ b/tests/ephy-web-app-utils-test.c
@@ -69,7 +69,7 @@ test_web_app_lifetime (void)
/* Test creation */
id = ephy_web_application_get_app_id_from_name (test.name);
desktop_file = ephy_web_application_create (id, test.url, test.name, NULL);
- g_assert_true (g_str_has_prefix (desktop_file, ephy_dot_dir ()));
+ g_assert_true (g_str_has_prefix (desktop_file, ephy_profile_dir ()));
g_assert_true (g_file_test (desktop_file, G_FILE_TEST_EXISTS));
/* Test the desktop file */
@@ -92,7 +92,7 @@ test_web_app_lifetime (void)
/* test profile directory */
profile_dir = ephy_web_application_get_profile_directory (id);
g_assert_true (g_str_has_prefix (desktop_file, profile_dir));
- g_assert_true (g_str_has_prefix (profile_dir, ephy_dot_dir ()));
+ g_assert_true (g_str_has_prefix (profile_dir, ephy_profile_dir ()));
g_assert_true (g_file_test (profile_dir, G_FILE_TEST_EXISTS));
/* Test proper symlink */
@@ -151,7 +151,7 @@ main (int argc, char *argv[])
/* Set $XDG_DATA_HOME to point to a directory inside our disposable
* profile directory. This allows us to test cleanly and safely.
* Note: $XDG_DATA_HOME default value is $HOME/.local/share/ */
- xdg_data_home = g_build_filename (ephy_dot_dir (), "xdg_share", NULL);
+ xdg_data_home = g_build_filename (ephy_profile_dir (), "xdg_share", NULL);
g_setenv ("XDG_DATA_HOME", xdg_data_home, TRUE);
gtk_test_init (&argc, &argv);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]