aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-05-11 20:22:11 +0800
committerChristian Persch <chpe@src.gnome.org>2006-05-11 20:22:11 +0800
commitb15ab14ae41b52fa6b14c283b937fb346b0cf9b6 (patch)
tree3f8910583345bb65dd2aaad65d2663f7695c4711 /src/bookmarks
parent1330c517db54e555af913755cee6dbe8bd823a6c (diff)
downloadgsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.tar
gsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.tar.gz
gsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.tar.bz2
gsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.tar.lz
gsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.tar.xz
gsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.tar.zst
gsoc2013-epiphany-b15ab14ae41b52fa6b14c283b937fb346b0cf9b6.zip
Don't crash when adding zeroconf bookmarks while bookmarks are locked
2006-05-11 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmarks.c: (add_to_favorites), (resolve_cb), (browse_cb): Don't crash when adding zeroconf bookmarks while bookmarks are locked down. Bug #341379.
Diffstat (limited to 'src/bookmarks')
-rw-r--r--src/bookmarks/ephy-bookmarks.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/bookmarks/ephy-bookmarks.c b/src/bookmarks/ephy-bookmarks.c
index 6262e268a..d08f02b30 100644
--- a/src/bookmarks/ephy-bookmarks.c
+++ b/src/bookmarks/ephy-bookmarks.c
@@ -350,6 +350,7 @@ add_to_favorites (EphyBookmarks *bookmarks,
gboolean full_menu;
double score;
+ if (ephy_node_db_is_immutable (priv->db)) return FALSE;
if (ephy_node_has_child (priv->favorites, node)) return FALSE;
url = ephy_node_get_property_string (node, EPHY_NODE_BMK_PROP_LOCATION);
@@ -831,6 +832,10 @@ resolve_cb (GnomeVFSDNSSDResolveHandle *handle,
GValue value = { 0, };
const char *path = NULL;
char *url;
+ gboolean was_immutable;
+
+ was_immutable = ephy_node_db_is_immutable (priv->db);
+ ephy_node_db_set_immutable (priv->db, FALSE);
g_hash_table_steal (priv->resolve_handles, node);
@@ -838,6 +843,9 @@ resolve_cb (GnomeVFSDNSSDResolveHandle *handle,
if (result != GNOME_VFS_OK)
{
ephy_node_unref (node);
+
+ ephy_node_db_set_immutable (priv->db, was_immutable);
+
return;
}
@@ -867,6 +875,8 @@ resolve_cb (GnomeVFSDNSSDResolveHandle *handle,
ephy_node_add_child (priv->bookmarks, node);
ephy_node_add_child (priv->local, node);
}
+
+ ephy_node_db_set_immutable (priv->db, was_immutable);
}
static void
@@ -907,6 +917,11 @@ browse_cb (GnomeVFSDNSSDBrowseHandle *handle,
if (node == NULL)
{
+ gboolean was_immutable;
+
+ was_immutable = ephy_node_db_is_immutable (priv->db);
+ ephy_node_db_set_immutable (priv->db, FALSE);
+
node = ephy_node_new (priv->db);
g_assert (node != NULL);
@@ -930,6 +945,8 @@ browse_cb (GnomeVFSDNSSDBrowseHandle *handle,
g_value_set_boolean (&value, TRUE);
ephy_node_set_property (node, EPHY_NODE_BMK_PROP_IMMUTABLE, &value);
g_value_unset (&value);
+
+ ephy_node_db_set_immutable (priv->db, was_immutable);
}
data = g_new (ResolveData, 1);