diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.c | 6 | ||||
-rwxr-xr-x | lib/egg/egg-toolbars-model.h | 2 | ||||
-rwxr-xr-x | src/ephy-toolbars-model.c | 6 |
4 files changed, 17 insertions, 5 deletions
@@ -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; |