aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarks-menu.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@it.gnome.org>2003-06-04 23:27:13 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-04 23:27:13 +0800
commit96b34afe3a6bffb9cb7a6671403de31644688cce (patch)
tree19394a0f2cbac65bfb8d8da8544199f3604fcec8 /src/bookmarks/ephy-bookmarks-menu.c
parent29bbfe00469fe536bbf0f1025cde834cec3bec0b (diff)
downloadgsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.gz
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.bz2
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.lz
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.xz
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.tar.zst
gsoc2013-epiphany-96b34afe3a6bffb9cb7a6671403de31644688cce.zip
Make sure to rebuild on add bookmark and on topic removal. Update on idle,
2003-06-04 Marco Pesenti Gritti <marco@it.gnome.org> * src/bookmarks/ephy-bookmarks-menu.c: (ephy_bookmarks_menu_rebuild), (do_updates), (bookmarks_tree_changed_cb), (ephy_bookmarks_menu_init): * src/bookmarks/ephy-bookmarks.c: (bookmarks_changed_cb), (topics_removed_cb), (ephy_bookmarks_add): Make sure to rebuild on add bookmark and on topic removal. Update on idle, so things like importing bookmarks doesnt take two days. * src/ephy-notebook.c: (notebook_drag_data_received_cb): * src/ephy-shell.c: (ephy_init_services), (load_homepage), (ephy_shell_new_tab): * src/ephy-shell.h: * src/ephy-window.c: (setup_window): * src/session.c: (parse_embed): Drop NOT_JUMP_TO flag, we dont have a pref anymore. On new page instead of really clone the page, just clone the url (put it in the address entry). So if the user need it it's easy to load, but there are not the inacceptable slow downs of real cloning. Let's see how this works ...
Diffstat (limited to 'src/bookmarks/ephy-bookmarks-menu.c')
-rw-r--r--src/bookmarks/ephy-bookmarks-menu.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c
index 89348a5e8..4182f125e 100644
--- a/src/bookmarks/ephy-bookmarks-menu.c
+++ b/src/bookmarks/ephy-bookmarks-menu.c
@@ -42,6 +42,7 @@ struct _EphyBookmarksMenuPrivate
EphyBookmarks *bookmarks;
EggActionGroup *action_group;
guint ui_id;
+ guint update_tag;
};
/**
@@ -322,7 +323,10 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu)
g_free (verb);
}
- add_bookmarks_menu (menu, not_categorized, xml);
+ if (ephy_node_get_n_children (not_categorized) > 0)
+ {
+ add_bookmarks_menu (menu, not_categorized, xml);
+ }
g_string_append (xml, "</placeholder></submenu></menu></Root>");
@@ -392,10 +396,23 @@ ephy_bookmarks_menu_class_init (EphyBookmarksMenuClass *klass)
G_PARAM_READWRITE));
}
+static gboolean
+do_updates (EphyBookmarksMenu *menu)
+{
+ ephy_bookmarks_menu_rebuild (menu);
+
+ menu->priv->update_tag = 0;
+
+ return FALSE;
+}
+
static void
bookmarks_tree_changed_cb (EphyBookmarks *bookmarks, EphyBookmarksMenu *menu)
{
- ephy_bookmarks_menu_rebuild (menu);
+ if (menu->priv->update_tag == 0)
+ {
+ menu->priv->update_tag = g_idle_add((GSourceFunc)do_updates, menu);
+ }
}
static void
@@ -412,6 +429,7 @@ ephy_bookmarks_menu_init (EphyBookmarksMenu *menu)
menu->priv->ui_id = -1;
menu->priv->action_group = NULL;
+ menu->priv->update_tag = 0;
}
static void