[Xfce4-commits] <xfce4-appfinder:master> Store item visibility.
Nick Schermer
noreply at xfce.org
Sat Jul 9 16:18:16 CEST 2011
Updating branch refs/heads/master
to 89cf9a85bcb0348cb1b3d4dd1820fafcfa9250b3 (commit)
from db76704f8547f1ec6efafa591341e35049faa131 (commit)
commit 89cf9a85bcb0348cb1b3d4dd1820fafcfa9250b3
Author: Nick Schermer <nick at xfce.org>
Date: Sun Jun 26 21:58:47 2011 +0200
Store item visibility.
garcon_menu_element_get_visible is kinda slow, so store
the value for quicker access.
src/appfinder-model.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/appfinder-model.c b/src/appfinder-model.c
index 9ee3665..3cdeb13 100644
--- a/src/appfinder-model.c
+++ b/src/appfinder-model.c
@@ -112,6 +112,7 @@ typedef struct
GPtrArray *categories;
gchar *command;
gchar *tooltip;
+ guint not_visible : 1;
GdkPixbuf *icon_small;
GdkPixbuf *icon_large;
@@ -694,6 +695,7 @@ xfce_appfinder_model_item_new (GarconMenuItem *menu_item)
}
item->key = xfce_appfinder_model_item_key (menu_item);
+ item->not_visible = !garcon_menu_element_get_visible (GARCON_MENU_ELEMENT (menu_item));
return item;
}
@@ -1208,7 +1210,7 @@ xfce_appfinder_model_get_visible (XfceAppfinderModel *model,
{
g_return_val_if_fail (GARCON_IS_MENU_ITEM (item->item), FALSE);
- if (!garcon_menu_element_get_visible (GARCON_MENU_ELEMENT (item->item)))
+ if (item->not_visible)
return FALSE;
if (category != NULL
More information about the Xfce4-commits
mailing list