aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog9
-rw-r--r--src/bookmarks/ephy-bookmarks.c16
2 files changed, 22 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f2d323f4d..8ff1c7b4c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2004-03-01 Christian Persch <chpe@cvs.gnome.org>
+ * src/bookmarks/ephy-bookmarks.c: (backup_file),
+ (ephy_bookmarks_init):
+
+ Don't try to backup non-existing files :)
+ Also, when neither ephy-bookmarks.xml nor bookmarks.rdf exist,
+ assume we have a new profile and don't warn about missing bookmarks.
+
+2004-03-01 Christian Persch <chpe@cvs.gnome.org>
+
* src/bookmarks/ephy-bookmark-action.c: (smart_child_added_cb),
(smart_child_removed_cb), (ephy_bookmark_action_init):
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 88e9c5d65..d9a0f7b7d 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -591,6 +591,11 @@ backup_file (const char *original_filename, const char *extension)
char *template, *backup_filename;
int result = 0;
+ if (g_file_test (original_filename, G_FILE_TEST_EXISTS) == FALSE)
+ {
+ return;
+ }
+
template = g_strconcat (original_filename, ".backup-XXXXXX", NULL);
backup_filename = ephy_file_tmp_filename (template, extension);
@@ -706,9 +711,14 @@ ephy_bookmarks_init (EphyBookmarks *eb)
eb->priv->smartbookmarks = ephy_node_new_with_id (db, SMARTBOOKMARKS_NODE_ID);
ephy_node_ref (eb->priv->smartbookmarks);
- if (ephy_node_db_load_from_file (eb->priv->db, eb->priv->xml_file,
- EPHY_BOOKMARKS_XML_ROOT,
- EPHY_BOOKMARKS_XML_VERSION) == FALSE)
+ if (g_file_test (eb->priv->xml_file, G_FILE_TEST_EXISTS) == FALSE
+ && g_file_test (eb->priv->rdf_file, G_FILE_TEST_EXISTS) == FALSE)
+ {
+ eb->priv->init_defaults = TRUE;
+ }
+ else if (ephy_node_db_load_from_file (eb->priv->db, eb->priv->xml_file,
+ EPHY_BOOKMARKS_XML_ROOT,
+ EPHY_BOOKMARKS_XML_VERSION) == FALSE)
{
/* save the corrupted files so the user can late try to
* manually recover them. See bug #128308.