From 27b2feab6994146b0adf0cdcdcc6f9d869d67d91 Mon Sep 17 00:00:00 2001 From: Christopher Michael Date: Sat, 8 Dec 2007 23:40:57 +0000 Subject: [PATCH] Some shelf fixes. - Use -1 during a call to evas_list_sort rather than evas_list_count. -1 will sort the whole list anyway, and we avoid the extra call to list_count. - Don't sort shelves during every add. They are sorted when e_shelf_list is called anyway. - Fix shelf numbering in the shelf list dialog. SVN revision: 33054 --- src/bin/e_shelf.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/bin/e_shelf.c b/src/bin/e_shelf.c index e0fefd366..417306640 100644 --- a/src/bin/e_shelf.c +++ b/src/bin/e_shelf.c @@ -72,16 +72,18 @@ e_shelf_config_init(void) cf_es = l->data; if (cf_es->id <= 0) cf_es->id = id + 1; zone = e_util_container_zone_id_get(cf_es->container, cf_es->zone); - id = cf_es->id; - if (zone) e_shelf_config_new(zone, cf_es); + if (zone) + { + id = cf_es->id; + e_shelf_config_new(zone, cf_es); + } } } EAPI Evas_List * e_shelf_list(void) { - shelves = evas_list_sort(shelves, evas_list_count(shelves), - _e_shelf_cb_id_sort); + shelves = evas_list_sort(shelves, -1, _e_shelf_cb_id_sort); return shelves; } @@ -183,7 +185,6 @@ e_shelf_zone_new(E_Zone *zone, const char *name, const char *style, int popup, i _e_shelf_cb_menu_items_append, es); shelves = evas_list_append(shelves, es); - shelves = evas_list_sort(shelves, -1, _e_shelf_cb_id_sort); es->hidden = 0; es->hide_step = 0;