aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@igalia.com>2012-12-12 20:09:39 +0800
committerXan Lopez <xan@igalia.com>2012-12-12 20:09:39 +0800
commitceab3ce08927ec45bb880371b7f31041a5192851 (patch)
tree8ab7c7d77d071f21e12954e89a5fefcacbcbac60
parent5660617413c37eb397a50361b6ca5bdd250b5be5 (diff)
downloadgsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.tar
gsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.tar.gz
gsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.tar.bz2
gsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.tar.lz
gsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.tar.xz
gsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.tar.zst
gsoc2013-epiphany-ceab3ce08927ec45bb880371b7f31041a5192851.zip
Define the names of the history and bookmarks files in just one place
-rw-r--r--embed/ephy-embed-shell.c3
-rw-r--r--lib/ephy-file-helpers.c2
-rw-r--r--lib/ephy-profile-migrator.c6
-rw-r--r--lib/ephy-profile-utils.h4
-rw-r--r--src/bookmarks/ephy-bookmarks.c5
-rw-r--r--tests/ephy-bookmarks-test.c3
6 files changed, 15 insertions, 8 deletions
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 9821d4f11..ea45a1433 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -31,6 +31,7 @@
#include "ephy-encodings.h"
#include "ephy-file-helpers.h"
#include "ephy-history-service.h"
+#include "ephy-profile-utils.h"
#include "ephy-snapshot-service.h"
#include <glib/gi18n.h>
@@ -124,7 +125,7 @@ ephy_embed_shell_get_global_history_service (EphyEmbedShell *shell)
if (shell->priv->global_history_service == NULL) {
char *filename;
- filename = g_build_filename (ephy_dot_dir (), "ephy-history.db", NULL);
+ filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
shell->priv->global_history_service = ephy_history_service_new (filename);
g_free (filename);
g_return_val_if_fail (shell->priv->global_history_service, NULL);
diff --git a/lib/ephy-file-helpers.c b/lib/ephy-file-helpers.c
index 898e218bd..b21b8a7f5 100644
--- a/lib/ephy-file-helpers.c
+++ b/lib/ephy-file-helpers.c
@@ -353,7 +353,7 @@ ephy_file_helpers_init (const char *profile_dir,
if (steal_data_from_profile && profile_dir)
{
int i;
- char *files_to_copy[] = { "ephy-history.db", "ephy-bookmarks.xml" };
+ char *files_to_copy[] = { EPHY_HISTORY_FILE, EPHY_BOOKMARKS_FILE };
for (i = 0; i < G_N_ELEMENTS (files_to_copy); i++)
{
diff --git a/lib/ephy-profile-migrator.c b/lib/ephy-profile-migrator.c
index c7cf49415..e757cbd80 100644
--- a/lib/ephy-profile-migrator.c
+++ b/lib/ephy-profile-migrator.c
@@ -559,11 +559,11 @@ migrate_history (void)
char buffer[1024];
HistoryParseData parse_data;
- gchar *temporary_file = g_build_filename (ephy_dot_dir (), "ephy-history.db", NULL);
+ gchar *temporary_file = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
/* Do nothing if the history file already exists. Safer than wiping
* it out. */
if (g_file_test (temporary_file, G_FILE_TEST_EXISTS)) {
- g_warning ("Did not migrate Epiphany's history, the ephy-history.db file already exists");
+ g_warning ("Did not migrate Epiphany's history, the %s file already exists", EPHY_HISTORY_FILE);
g_free (temporary_file);
return;
}
@@ -779,7 +779,7 @@ migrate_new_urls_table (void)
char *filename;
GError *error = NULL;
- filename = g_build_filename (ephy_dot_dir (), "ephy-history.db", NULL);
+ filename = g_build_filename (ephy_dot_dir (), EPHY_HISTORY_FILE, NULL);
history_database = ephy_sqlite_connection_new ();
ephy_sqlite_connection_open (history_database, filename, &error);
diff --git a/lib/ephy-profile-utils.h b/lib/ephy-profile-utils.h
index 5a9b84433..1e9d071db 100644
--- a/lib/ephy-profile-utils.h
+++ b/lib/ephy-profile-utils.h
@@ -28,6 +28,10 @@
#define EPHY_PROFILE_MIGRATION_VERSION 8
+#define EPHY_HISTORY_FILE "ephy-history.db"
+#define EPHY_BOOKMARKS_FILE "ephy-bookmarks.xml"
+#define EPHY_BOOKMARKS_FILE_RDF "bookmarks.rdf"
+
int ephy_profile_utils_get_migration_version (void);
gboolean ephy_profile_utils_set_migration_version (int version);
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 67917bc0e..ac41a64bd 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -32,6 +32,7 @@
#include "ephy-history-service.h"
#include "ephy-node-common.h"
#include "ephy-prefs.h"
+#include "ephy-profile-utils.h"
#include "ephy-settings.h"
#include "ephy-shell.h"
#include "ephy-signal-accumulator.h"
@@ -957,10 +958,10 @@ ephy_bookmarks_init (EphyBookmarks *eb)
eb->priv->db = db;
eb->priv->xml_file = g_build_filename (ephy_dot_dir (),
- "ephy-bookmarks.xml",
+ EPHY_BOOKMARKS_FILE,
NULL);
eb->priv->rdf_file = g_build_filename (ephy_dot_dir (),
- "bookmarks.rdf",
+ EPHY_BOOKMARKS_FILE_RDF,
NULL);
/* Bookmarks */
diff --git a/tests/ephy-bookmarks-test.c b/tests/ephy-bookmarks-test.c
index ca1f780fe..06be0e3de 100644
--- a/tests/ephy-bookmarks-test.c
+++ b/tests/ephy-bookmarks-test.c
@@ -23,8 +23,9 @@
#include "ephy-debug.h"
#include "ephy-file-helpers.h"
+#include "ephy-profile-utils.h"
-const char* bookmarks_paths[] = { "ephy-bookmarks.xml", "bookmarks.rdf", NULL };
+const char* bookmarks_paths[] = { EPHY_BOOKMARKS_FILE, EPHY_BOOKMARKS_FILE_RDF, NULL };
static void
clear_bookmark_files (void)