aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-06-06 15:13:55 +0800
committerMarco Pesenti Gritti <mpeseng@src.gnome.org>2003-06-06 15:13:55 +0800
commit6c217beb4ac1ec20a3f5407714efcb16020811fd (patch)
tree841b60bc281ba2d9d8215b3e0cc0300a7f61e154 /src
parent6a8a736a25d0274d8ddcc5e63d8a6f1a535ea439 (diff)
downloadgsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.tar
gsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.tar.gz
gsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.tar.bz2
gsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.tar.lz
gsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.tar.xz
gsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.tar.zst
gsoc2013-epiphany-6c217beb4ac1ec20a3f5407714efcb16020811fd.zip
Fix signed/unsigned mistake, speed up favorites menu building
2003-06-06 Christian Persch <chpe@cvs.gnome.org> * src/bookmarks/ephy-bookmarks-menu.c: (ephy_bookmarks_menu_clean), (ephy_bookmarks_menu_rebuild), (ephy_bookmarks_menu_init): * src/ephy-favorites-menu.c: (ephy_favorites_menu_clean), (ephy_favorites_menu_rebuild), (ephy_favorites_menu_init): Fix signed/unsigned mistake, speed up favorites menu building
Diffstat (limited to 'src')
-rw-r--r--src/bookmarks/ephy-bookmarks-menu.c11
-rw-r--r--src/ephy-favorites-menu.c11
2 files changed, 16 insertions, 6 deletions
diff --git a/src/bookmarks/ephy-bookmarks-menu.c b/src/bookmarks/ephy-bookmarks-menu.c
index 4182f125e..da186741e 100644
--- a/src/bookmarks/ephy-bookmarks-menu.c
+++ b/src/bookmarks/ephy-bookmarks-menu.c
@@ -93,10 +93,11 @@ ephy_bookmarks_menu_clean (EphyBookmarksMenu *menu)
EphyBookmarksMenuPrivate *p = menu->priv;
EggMenuMerge *merge = EGG_MENU_MERGE (p->window->ui_merge);
- if (p->ui_id >= 0)
+ if (p->ui_id > 0)
{
egg_menu_merge_remove_ui (merge, p->ui_id);
egg_menu_merge_ensure_update (merge);
+ p->ui_id = 0;
}
if (p->action_group != NULL)
@@ -248,7 +249,9 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu)
GList *node_list = NULL, *l;
EggAction *empty;
- LOG ("Rebuilding recent history menu")
+ LOG ("Rebuilding bookmarks menu")
+
+ START_PROFILER ("Rebuilding bookmarks menu")
ephy_bookmarks_menu_clean (menu);
@@ -340,6 +343,8 @@ ephy_bookmarks_menu_rebuild (EphyBookmarksMenu *menu)
g_string_free (xml, TRUE);
g_list_free (node_list);
+
+ STOP_PROFILER ("Rebuilding bookmarks menu")
}
static void
@@ -427,7 +432,7 @@ ephy_bookmarks_menu_init (EphyBookmarksMenu *menu)
G_CALLBACK (bookmarks_tree_changed_cb),
menu);
- menu->priv->ui_id = -1;
+ menu->priv->ui_id = 0;
menu->priv->action_group = NULL;
menu->priv->update_tag = 0;
}
diff --git a/src/ephy-favorites-menu.c b/src/ephy-favorites-menu.c
index f5da952d3..e30353dac 100644
--- a/src/ephy-favorites-menu.c
+++ b/src/ephy-favorites-menu.c
@@ -85,10 +85,11 @@ ephy_favorites_menu_clean (EphyFavoritesMenu *wrhm)
EphyFavoritesMenuPrivate *p = wrhm->priv;
EggMenuMerge *merge = EGG_MENU_MERGE (p->window->ui_merge);
- if (p->ui_id >= 0)
+ if (p->ui_id > 0)
{
egg_menu_merge_remove_ui (merge, p->ui_id);
egg_menu_merge_ensure_update (merge);
+ p->ui_id = 0;
}
if (p->action_group != NULL)
@@ -119,7 +120,9 @@ ephy_favorites_menu_rebuild (EphyFavoritesMenu *wrhm)
GPtrArray *children;
EggMenuMerge *merge = EGG_MENU_MERGE (p->window->ui_merge);
- LOG ("Rebuilding recent history menu")
+ LOG ("Rebuilding favorites menu")
+
+ START_PROFILER ("Rebuild favorites menu")
ephy_favorites_menu_clean (wrhm);
@@ -169,6 +172,8 @@ ephy_favorites_menu_rebuild (EphyFavoritesMenu *wrhm)
}
g_string_free (xml, TRUE);
+
+ STOP_PROFILER ("Rebuild favorites menu")
}
static void
@@ -232,7 +237,7 @@ ephy_favorites_menu_init (EphyFavoritesMenu *wrhm)
wrhm->priv = p;
wrhm->priv->bookmarks = ephy_shell_get_bookmarks (ephy_shell);
- wrhm->priv->ui_id = -1;
+ wrhm->priv->ui_id = 0;
wrhm->priv->action_group = NULL;
}