From 72191ab69224b09591fc36ebbaab311000b72b05 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Wed, 19 Feb 2014 10:30:10 +0000 Subject: [PATCH] Fix T966, sort order of child folders. Comparison was being incorrectly applied for child elements - they need to be treated differently if there are no siblings --- legacy/elementary/src/lib/elm_genlist.c | 37 ++++++++++++++++--------- 1 file changed, 24 insertions(+), 13 deletions(-) diff --git a/legacy/elementary/src/lib/elm_genlist.c b/legacy/elementary/src/lib/elm_genlist.c index 4dbda67e4d..1846cb2bb0 100644 --- a/legacy/elementary/src/lib/elm_genlist.c +++ b/legacy/elementary/src/lib/elm_genlist.c @@ -5758,26 +5758,37 @@ _item_sorted_insert(Eo *obj EINA_UNUSED, void *_pd, va_list *list) &cmp_result); if (l) - rel = eina_list_data_get(l); - else - rel = it->parent; - - if (cmp_result >= 0) { + rel = eina_list_data_get(l); + + if (cmp_result >= 0) + { + it->parent->item->items = eina_list_prepend_relative_list + (it->parent->item->items, it, l); + sd->items = eina_inlist_prepend_relative + (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel)); + it->item->before = EINA_TRUE; + } + else if (cmp_result < 0) + { + it->parent->item->items = eina_list_append_relative_list + (it->parent->item->items, it, l); + sd->items = eina_inlist_append_relative + (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel)); + it->item->before = EINA_FALSE; + } + } + else + { + rel = it->parent; + + // ignoring the comparison it->parent->item->items = eina_list_prepend_relative_list (it->parent->item->items, it, l); sd->items = eina_inlist_prepend_relative (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel)); it->item->before = EINA_FALSE; } - else if (cmp_result < 0) - { - it->parent->item->items = eina_list_append_relative_list - (it->parent->item->items, it, l); - sd->items = eina_inlist_append_relative - (sd->items, EINA_INLIST_GET(it), EINA_INLIST_GET(rel)); - it->item->before = EINA_TRUE; - } } else {