handle case where new songs are inserted to the middle of the list
math++++
This commit is contained in:
parent
f35a5f247e
commit
4ce1ea622d
|
@ -2850,6 +2850,25 @@ queue_list_handler(Eina_Value *value, Eina_Bool update)
|
|||
}
|
||||
}
|
||||
}
|
||||
/* songs being inserted before end */
|
||||
else if (so->song_pos < eina_hash_population(empd_current_queue))
|
||||
{
|
||||
int i, num;
|
||||
|
||||
/* delete #items until insert point reached */
|
||||
num = eina_list_count(songs->songs) -
|
||||
(empd_queue_length - eina_hash_population(empd_current_queue));
|
||||
for (i = 0; i < num; i++)
|
||||
{
|
||||
Elm_Object_Item *it;
|
||||
|
||||
/* skip header item... */
|
||||
it = elm_genlist_item_prev_get(elm_genlist_last_item_get(queue_list));
|
||||
//Empd_Empdd_Song *ss = elm_object_item_data_get(it);
|
||||
//fprintf(stderr, "2863 DEL %s\n", ss->title);
|
||||
elm_object_item_del(it);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (update)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue