aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Harvey <peter.a.harvey@gmail.com>2006-02-14 20:32:09 +0800
committerPeter Anthony Harvey <paharvey@src.gnome.org>2006-02-14 20:32:09 +0800
commit9d6391aba379d4032d8be1d63d9535cb36163197 (patch)
treeb543ba6cb32aaaaf2ad8e8cf8a303e7e1a136962
parent92eb07864379444f9ecee4ac14d9a4bb8939aaa2 (diff)
downloadgsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.gz
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.bz2
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.lz
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.xz
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.tar.zst
gsoc2013-epiphany-9d6391aba379d4032d8be1d63d9535cb36163197.zip
src/bookmarks/ephy-bookmarks-editor.c
2006-02-10 Peter Harvey <peter.a.harvey@gmail.com> * src/bookmarks/ephy-bookmarks-editor.c Do not create the bookmarks bar when removing bookmarks from the toolbar. * lib/egg/egg-toolbars-model.c Fix infinite loop when a toolbar has no items on it.
-rw-r--r--ChangeLog13
-rwxr-xr-xlib/egg/egg-toolbars-model.c2
-rw-r--r--src/bookmarks/ephy-bookmarks-editor.c40
3 files changed, 43 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index 501848eb3..a90333d68 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,15 @@
-006-02-14 Christian Persch <chpe@cvs.gnome.org>
+2006-02-10 Peter Harvey <peter.a.harvey@gmail.com>
+
+ * src/bookmarks/ephy-bookmarks-editor.c
+
+ Do not create the bookmarks bar when removing bookmarks
+ from the toolbar.
+
+ * lib/egg/egg-toolbars-model.c
+
+ Fix infinite loop when a toolbar has no items on it.
+
+2006-02-14 Christian Persch <chpe@cvs.gnome.org>
* configure.ac:
diff --git a/lib/egg/egg-toolbars-model.c b/lib/egg/egg-toolbars-model.c
index 51ada3703..3162c304a 100755
--- a/lib/egg/egg-toolbars-model.c
+++ b/lib/egg/egg-toolbars-model.c
@@ -872,8 +872,10 @@ egg_toolbars_model_delete_item (EggToolbarsModel *model,
item = g_node_first_child (toolbar);
ipos = 0;
+ /* Don't delete toolbars that were already empty */
if (item == NULL)
{
+ toolbar = g_node_next_sibling (toolbar);
continue;
}
diff --git a/src/bookmarks/ephy-bookmarks-editor.c b/src/bookmarks/ephy-bookmarks-editor.c
index 039f8a251..3158953d1 100644
--- a/src/bookmarks/ephy-bookmarks-editor.c
+++ b/src/bookmarks/ephy-bookmarks-editor.c
@@ -426,19 +426,11 @@ delete_topic_dialog_construct (GtkWindow *parent,
return dialog;
}
-static void
-cmd_toolbar (GtkAction *action,
- EphyBookmarksEditor *editor)
+static gint
+get_bookmarks_bar (EggToolbarsModel *model)
{
- EggToolbarsModel *model;
- EphyNode *node;
- gboolean show;
+ gint tpos;
const char *tname;
- gint flags, tpos;
- GList *selection;
- GList *l;
-
- model = EGG_TOOLBARS_MODEL (ephy_shell_get_toolbars_model (ephy_shell_get_default (), FALSE));
for (tpos = 0; tpos < egg_toolbars_model_n_toolbars (model); tpos++)
{
@@ -454,6 +446,22 @@ cmd_toolbar (GtkAction *action,
tpos = egg_toolbars_model_add_toolbar (model, -1, "BookmarksBar");
}
+ return tpos;
+}
+
+static void
+cmd_toolbar (GtkAction *action,
+ EphyBookmarksEditor *editor)
+{
+ EggToolbarsModel *model;
+ EphyNode *node;
+ gboolean show;
+ gint flags, tpos = 0;
+ GList *selection;
+ GList *l;
+
+ model = EGG_TOOLBARS_MODEL (ephy_shell_get_toolbars_model (ephy_shell_get_default (), FALSE));
+
if (ephy_node_view_is_target (EPHY_NODE_VIEW (editor->priv->bm_view)))
{
char name[EPHY_BOOKMARK_ACTION_NAME_BUFFER_SIZE];
@@ -466,6 +474,11 @@ cmd_toolbar (GtkAction *action,
flags = egg_toolbars_model_get_name_flags (model, name);
show = ((flags & EGG_TB_MODEL_NAME_USED) == 0);
+
+ if (show)
+ {
+ tpos = get_bookmarks_bar (model);
+ }
for (l = selection; l; l = l->next)
{
@@ -499,6 +512,11 @@ cmd_toolbar (GtkAction *action,
flags = egg_toolbars_model_get_name_flags (model, name);
show = ((flags & EGG_TB_MODEL_NAME_USED) == 0);
+ if (show)
+ {
+ tpos = get_bookmarks_bar (model);
+ }
+
for (l = selection; l; l = l->next)
{
node = l->data;