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
This commit is contained in:
Andy Williams 2014-02-19 10:30:10 +00:00
parent 9b23d6e02b
commit 72191ab692
1 changed files with 24 additions and 13 deletions

View File

@ -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
{