aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2004-06-21 19:26:37 +0800
committerChristian Persch <chpe@src.gnome.org>2004-06-21 19:26:37 +0800
commit157bf334e0f70f7bdea8c19fd310505449291677 (patch)
tree5d3f1ad670a45ed1f7ead1c389e2ec0188e87684
parentab5f74ea9c207799a9ea36d4ddac46790e3ecfb5 (diff)
downloadgsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.tar
gsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.tar.gz
gsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.tar.bz2
gsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.tar.lz
gsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.tar.xz
gsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.tar.zst
gsoc2013-epiphany-157bf334e0f70f7bdea8c19fd310505449291677.zip
Check for empty attributes before adding the item when parsing the
2004-06-21 Christian Persch <chpe@cvs.gnome.org> * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_get_flags), (parse_item_list), (parse_toolbars): Check for empty attributes before adding the item when parsing the toolbars file. Should fix bug #144698.
-rw-r--r--ChangeLog8
-rwxr-xr-xlib/egg/egg-toolbars-model.c19
2 files changed, 19 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index d50692750..463518fed 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2004-06-21 Christian Persch <chpe@cvs.gnome.org>
+ * lib/egg/egg-toolbars-model.c: (egg_toolbars_model_get_flags),
+ (parse_item_list), (parse_toolbars):
+
+ Check for empty attributes before adding the item when parsing
+ the toolbars file. Should fix bug #144698.
+
+2004-06-21 Christian Persch <chpe@cvs.gnome.org>
+
* src/bookmarks/ephy-bookmarks-import.c: (ephy_bookmarks_import):
Allow importing from Epiphany bookmarks format (RDF),
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index b6f1b8717..f10dcc25b 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -270,7 +270,7 @@ egg_toolbars_model_get_flags (EggToolbarsModel *t,
EggToolbarsToolbar *toolbar;
toolbar_node = g_node_nth_child (t->priv->toolbars, toolbar_position);
- g_return_val_if_fail (toolbar_node != NULL, -1);
+ g_return_val_if_fail (toolbar_node != NULL, 0);
toolbar = toolbar_node->data;
@@ -364,17 +364,20 @@ parse_item_list (EggToolbarsModel *t,
type = xmlGetProp (child, "type");
if (type == NULL)
{
- type = g_strdup (EGG_TOOLBAR_ITEM_TYPE);
+ type = xmlStrdup (EGG_TOOLBAR_ITEM_TYPE);
}
- id = egg_toolbars_model_get_item_id (t, type, name);
- if (id != NULL)
+ if (name != NULL && name[0] != '\0' && type != NULL)
{
- egg_toolbars_model_add_item (t, position, -1, id, type);
+ id = egg_toolbars_model_get_item_id (t, type, name);
+ if (id != NULL)
+ {
+ egg_toolbars_model_add_item (t, position, -1, id, type);
+ }
+ g_free (id);
}
xmlFree (name);
- g_free (type);
- g_free (id);
+ xmlFree (type);
}
else if (xmlStrEqual (child->name, "separator"))
{
@@ -423,7 +426,7 @@ parse_toolbars (EggToolbarsModel *t,
xmlFree (name);
style = xmlGetProp (child, "style");
- if (style && strcmp (style, "icons-only") == 0)
+ if (style && xmlStrEqual (style, "icons-only"))
{
egg_toolbars_model_set_flags (t, EGG_TB_MODEL_ICONS_ONLY, 0);
}