discomfitor pushed a commit to branch master.

http://git.enlightenment.org/apps/empc.git/commit/?id=92aa6470b8f542e532e976cf4a103dc6741433a4

commit 92aa6470b8f542e532e976cf4a103dc6741433a4
Author: Mike Blumenkrantz <[email protected]>
Date:   Thu Jan 22 18:49:50 2015 -0500

    fix re-selecting on queue update
---
 src/bin/empc.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/bin/empc.c b/src/bin/empc.c
index 4333ec7..e686d9d 100644
--- a/src/bin/empc.c
+++ b/src/bin/empc.c
@@ -2743,19 +2743,18 @@ queue_list_handler(Eina_Value *value, Eina_Bool cached)
         Elm_Object_Item *it;
         const Eina_List *l, *its = elm_genlist_selected_items_get(queue_list);
         elm_scroller_region_get(queue_list, &x, &y, &w, &h);
-        queue_list_clear();
         if (its)
           {
              EINA_LIST_FOREACH(its, l, it)
                sel = eina_list_append(sel, 
Empd_Empdd_Song_copy(elm_object_item_data_get(it)));
           }
+        queue_list_clear();
         reset = EINA_TRUE;
      }
    EINA_LIST_FREE(songs->songs, so)
      {
         Elm_Object_Item *it = NULL;
         Empd_Empdd_Song *sop;
-        Eina_List *l, *ll;
 
         if (cached || noclear)
           {
@@ -2835,18 +2834,19 @@ queue_list_handler(Eina_Value *value, Eina_Bool cached)
              if (itl)
                
elm_genlist_item_fields_update(elm_genlist_item_parent_get(itl), 
EMPC_TEXT_TIME, ELM_GENLIST_ITEM_FIELD_TEXT);
           }
-        EINA_LIST_FOREACH_SAFE(sel, l, ll, sop)
-          {
-             if (!Empd_Empdd_Song_eq(so, sop)) continue;
-             elm_genlist_item_selected_set(it, EINA_TRUE);
-             sel = eina_list_remove_list(sel, l);
-             Empd_Empdd_Song_free(sop);
-          }
-        E_FREE_LIST(sel, Empd_Empdd_Song_free);
         album = so->album;
         artist = so->artist;
         itl = it;
      }
+   selecting = EINA_TRUE;
+   EINA_LIST_FREE(sel, so)
+     {
+        itl = eina_hash_find(empd_current_queue, &so->songid);
+        if (itl)
+          elm_genlist_item_selected_set(itl, EINA_TRUE);
+        Empd_Empdd_Song_free(so);
+     }
+   selecting = EINA_FALSE;
    free(songs);
    if (noclear)
      noclear--;

-- 


Reply via email to