[epiphany/wip/tingping/profile-migration: 1/4] Rename ephy_dot_dir() to ephy_profile_dir()
- From: Patrick Griffis <pgriffis src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/wip/tingping/profile-migration: 1/4] Rename ephy_dot_dir() to ephy_profile_dir()
- Date: Sun, 6 Jan 2019 18:56:47 +0000 (UTC)
commit 2c35df2dc895e251919cf971e0e4954b1591050b
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 | 8 +--
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, 87 insertions(+), 101 deletions(-)
---
diff --git a/embed/ephy-embed-prefs.c b/embed/ephy-embed-prefs.c
index e7884c334..4ec3500a3 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 66e790ec7..7504392dd 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -762,7 +762,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);
@@ -961,7 +961,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);
@@ -1091,8 +1091,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 ();
@@ -1105,18 +1103,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);
@@ -1294,7 +1283,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);
@@ -1576,7 +1565,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);
}
@@ -1597,7 +1586,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);
@@ -1637,7 +1626,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);
}
@@ -1661,7 +1650,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 0da9815b5..3a9b19ba3 100644
--- a/embed/web-extension/ephy-web-extension.c
+++ b/embed/web-extension/ephy-web-extension.c
@@ -763,7 +763,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 001f1491d..06b88fddd 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -68,11 +68,11 @@ 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 GList *del_on_exit;
-static EphyProfileDirType dot_dir_type;
+static EphyProfileDirType profile_dir_type;
GQuark ephy_file_helpers_error_quark;
@@ -221,17 +221,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;
}
/**
@@ -250,44 +250,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);
}
@@ -301,8 +301,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);
}
@@ -339,18 +339,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) {
@@ -362,27 +362,26 @@ 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;
@@ -399,7 +398,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);
@@ -451,9 +450,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) {
@@ -497,7 +494,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
@@ -991,7 +988,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 9b5d08a57..b91dda20b 100644
--- a/lib/ephy-file-helpers.h
+++ b/lib/ephy-file-helpers.h
@@ -51,11 +51,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 8a66cb979..917eabba8 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 a75ae995f..92d078667 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 483c1f1fd..a6a798a63 100644
--- a/src/ephy-window.c
+++ b/src/ephy-window.c
@@ -3147,7 +3147,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 761af6d03..2a48bcd22 100644
--- a/src/prefs-dialog.c
+++ b/src/prefs-dialog.c
@@ -1107,7 +1107,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));
@@ -1927,7 +1927,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 b612d1afa..ab404b489 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))
@@ -590,7 +590,7 @@ migrate_settings (void)
* so if the profile dir is not the default one, it's a web app.
* If not a web app, migrate deprecated settings.
*/
- if (ephy_dot_dir_is_default () || legacy_dir_is_default ()) {
+ if (ephy_profile_dir_is_default () || legacy_dir_is_default ()) {
migrate_deprecated_settings ();
return;
}
@@ -1363,7 +1363,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;
@@ -1397,7 +1397,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 2f39aff28..88bf5567e 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 44e6880a7..b73a3cc97 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 (ephy_dot_dir () == NULL);
+ g_assert (ephy_profile_dir () == NULL);
g_assert (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 (tmp_dir != NULL);
g_assert (dot_dir != NULL);
diff --git a/tests/ephy-web-app-utils-test.c b/tests/ephy-web-app-utils-test.c
index eea5a030a..486195d81 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 (g_str_has_prefix (desktop_file, ephy_dot_dir ()));
+ g_assert (g_str_has_prefix (desktop_file, ephy_profile_dir ()));
g_assert (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 (g_str_has_prefix (desktop_file, profile_dir));
- g_assert (g_str_has_prefix (profile_dir, ephy_dot_dir ()));
+ g_assert (g_str_has_prefix (profile_dir, ephy_profile_dir ()));
g_assert (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]