diff options
author | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-06-17 12:07:22 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2016-06-17 12:07:22 -0400 |
commit | 4ce1ea622da35bb45b2bce9d399b6aea3f03bcad (patch) | |
tree | 5ded142e26b39e019dc9b4837379a179c5ee01ef /src | |
parent | f35a5f247e6b5446638b14465a20862ee928e702 (diff) |
handle case where new songs are inserted to the middle of the list
math++++
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/empc.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/bin/empc.c b/src/bin/empc.c index d1a4d69..145dd00 100644 --- a/src/bin/empc.c +++ b/src/bin/empc.c | |||
@@ -2850,6 +2850,25 @@ queue_list_handler(Eina_Value *value, Eina_Bool update) | |||
2850 | } | 2850 | } |
2851 | } | 2851 | } |
2852 | } | 2852 | } |
2853 | /* songs being inserted before end */ | ||
2854 | else if (so->song_pos < eina_hash_population(empd_current_queue)) | ||
2855 | { | ||
2856 | int i, num; | ||
2857 | |||
2858 | /* delete #items until insert point reached */ | ||
2859 | num = eina_list_count(songs->songs) - | ||
2860 | (empd_queue_length - eina_hash_population(empd_current_queue)); | ||
2861 | for (i = 0; i < num; i++) | ||
2862 | { | ||
2863 | Elm_Object_Item *it; | ||
2864 | |||
2865 | /* skip header item... */ | ||
2866 | it = elm_genlist_item_prev_get(elm_genlist_last_item_get(queue_list)); | ||
2867 | //Empd_Empdd_Song *ss = elm_object_item_data_get(it); | ||
2868 | //fprintf(stderr, "2863 DEL %s\n", ss->title); | ||
2869 | elm_object_item_del(it); | ||
2870 | } | ||
2871 | } | ||
2853 | } | 2872 | } |
2854 | else if (update) | 2873 | else if (update) |
2855 | { | 2874 | { |