aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-11-10 20:09:56 +0800
committerChristian Persch <chpe@src.gnome.org>2003-11-10 20:09:56 +0800
commite0e28a194f0b59712b096bbde4d6181739f1d975 (patch)
tree3cfe637e0b5b3198066a8a6e824c5ba7df9da520
parent90a594297c72e0e4515e14fcbabec554be30b399 (diff)
downloadgsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.tar
gsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.tar.gz
gsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.tar.bz2
gsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.tar.lz
gsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.tar.xz
gsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.tar.zst
gsoc2013-epiphany-e0e28a194f0b59712b096bbde4d6181739f1d975.zip
Fix recovery from corrupted toolbar layout file.
2003-11-10 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_load): * lib/egg/egg-toolbars-model.h: * src/ephy-toolbars-model.c: (ephy_toolbars_model_set_bookmarks): Fix recovery from corrupted toolbar layout file.
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/egg/egg-toolbars-model.c6
-rwxr-xr-xlib/egg/egg-toolbars-model.h2
-rwxr-xr-xsrc/ephy-toolbars-model.c6
4 files changed, 17 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index a304a768d..5ac99432b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-11-10 Christian Persch <chpe@cvs.gnome.org>
+
+ * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_load):
+ * lib/egg/egg-toolbars-model.h:
+ * src/ephy-toolbars-model.c: (ephy_toolbars_model_set_bookmarks):
+
+ Fix recovery from corrupted toolbar layout file.
+
2003-11-10 Marco Pesenti Gritti <marco@gnome.org>
* embed/mozilla/MozDownload.cpp:
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index 091604087..7fbafe99c 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -431,7 +431,7 @@ parse_toolbars (EggToolbarsModel *t,
}
}
-void
+gboolean
egg_toolbars_model_load (EggToolbarsModel *t,
const char *xml_file)
{
@@ -444,7 +444,7 @@ egg_toolbars_model_load (EggToolbarsModel *t,
if (doc == NULL)
{
g_warning ("Failed to load XML data from %s", xml_file);
- return;
+ return FALSE;
}
root = xmlDocGetRootElement (doc);
@@ -452,6 +452,8 @@ egg_toolbars_model_load (EggToolbarsModel *t,
parse_toolbars (t, root->children);
xmlFreeDoc (doc);
+
+ return TRUE;
}
static char *
diff --git a/lib/egg/egg-toolbars-model.h b/lib/egg/egg-toolbars-model.h
index baf4b6ac6..0f3b2d31a 100755
--- a/lib/egg/egg-toolbars-model.h
+++ b/lib/egg/egg-toolbars-model.h
@@ -87,7 +87,7 @@ struct EggToolbarsModelClass
GType egg_toolbars_model_get_type (void);
EggToolbarsModel *egg_toolbars_model_new (void);
-void egg_toolbars_model_load (EggToolbarsModel *t,
+gboolean egg_toolbars_model_load (EggToolbarsModel *t,
const char *xml_file);
void egg_toolbars_model_save (EggToolbarsModel *t,
const char *xml_file,
diff --git a/src/ephy-toolbars-model.c b/src/ephy-toolbars-model.c
index c61f66161..f43acfb83 100755
--- a/src/ephy-toolbars-model.c
+++ b/src/ephy-toolbars-model.c
@@ -323,6 +323,7 @@ static void
ephy_toolbars_model_set_bookmarks (EphyToolbarsModel *model, EphyBookmarks *bookmarks)
{
EggToolbarsModel *egg_model = EGG_TOOLBARS_MODEL (model);
+ gboolean success = FALSE;
model->priv->bookmarks = bookmarks;
g_object_ref (model->priv->bookmarks);
@@ -331,10 +332,11 @@ ephy_toolbars_model_set_bookmarks (EphyToolbarsModel *model, EphyBookmarks *book
if (g_file_test (model->priv->xml_file, G_FILE_TEST_EXISTS))
{
- egg_toolbars_model_load (egg_model,
+ success = egg_toolbars_model_load (egg_model,
model->priv->xml_file);
}
- else
+
+ if (success == FALSE)
{
const char *default_xml;