discomfitor pushed a commit to branch master.

http://git.enlightenment.org/apps/empc.git/commit/?id=4ce1ea622da35bb45b2bce9d399b6aea3f03bcad

commit 4ce1ea622da35bb45b2bce9d399b6aea3f03bcad
Author: Mike Blumenkrantz <[email protected]>
Date:   Fri Jun 17 12:07:22 2016 -0400

    handle case where new songs are inserted to the middle of the list
    
    math++++
---
 src/bin/empc.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

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)
                     }
                }
           }
+        /* 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)
      {

-- 


Reply via email to