forked from enlightenment/efl
massive, massive, MASSIVE spankies to the person that wrote gengrid's sorted insert functions. cannot overstate the size of the spankies that await you if I decide to look through the svn logs.
also fixes ticket #984 --This line \ , and those below, will be ignored-- M lib/elm_gengrid.c SVN revision: 72139
This commit is contained in:
parent
3f370e5148
commit
e2d63d4c40
|
@ -1830,9 +1830,19 @@ static int
|
|||
_elm_gengrid_item_compare(const void *data, const void *data1)
|
||||
{
|
||||
Elm_Gen_Item *it, *item1;
|
||||
Eina_Compare_Cb cb = NULL;
|
||||
ptrdiff_t d;
|
||||
it = ELM_GEN_ITEM_FROM_INLIST(data);
|
||||
item1 = ELM_GEN_ITEM_FROM_INLIST(data1);
|
||||
return it->wd->item_compare_cb(it, item1);
|
||||
if (it && it->wd && it->wd->item_compare_cb)
|
||||
cb = it->wd->item_compare_cb;
|
||||
else if (item1 && item1->wd && item1->wd->item_compare_cb)
|
||||
cb = item1->wd->item_compare_cb;
|
||||
if (cb && it && item1) return cb(it, item1);
|
||||
d = data - data1;
|
||||
if (d < 0) return -1;
|
||||
if (!d) return 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2195,7 +2205,10 @@ elm_gengrid_item_sorted_insert(Evas_Object *obj,
|
|||
if (!it) return NULL;
|
||||
|
||||
if (!wd->state)
|
||||
wd->state = eina_inlist_sorted_state_new();
|
||||
{
|
||||
wd->state = eina_inlist_sorted_state_new();
|
||||
eina_inlist_sorted_state_init(wd->state, wd->items);
|
||||
}
|
||||
|
||||
wd->item_compare_cb = comp;
|
||||
wd->items = eina_inlist_sorted_state_insert(wd->items, EINA_INLIST_GET(it),
|
||||
|
|
Loading…
Reference in New Issue