summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@osg.samsung.com>2015-11-06 17:26:08 -0500
committerMike Blumenkrantz <zmike@osg.samsung.com>2015-11-06 17:26:08 -0500
commit3a149bc52c9072d121fe694a288684ae49db07fc (patch)
tree33b740e839c24e15a179ee00e7542b974b2556cd /src
parent5d1baba0aa5b4b0d1681110ad49c2cd179573214 (diff)
break out ranged queue list deletion into util function
Diffstat (limited to 'src')
-rw-r--r--src/bin/empc.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/bin/empc.c b/src/bin/empc.c
index c4daa48..9bcec4d 100644
--- a/src/bin/empc.c
+++ b/src/bin/empc.c
@@ -2163,9 +2163,8 @@ queue_list_item_realize(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, vo
2163} 2163}
2164 2164
2165static void 2165static void
2166queue_list_delete_selected(void) 2166queue_list_delete_list(const Eina_List *items)
2167{ 2167{
2168 const Eina_List *items;
2169 Eina_List *l, *headers = NULL; 2168 Eina_List *l, *headers = NULL;
2170 int start = -1, num = 0, total = 0; 2169 int start = -1, num = 0, total = 0;
2171 Elm_Object_Item *it, *next, *hdr = NULL; 2170 Elm_Object_Item *it, *next, *hdr = NULL;
@@ -2173,10 +2172,8 @@ queue_list_delete_selected(void)
2173 Empd_Empdd_Song *so; 2172 Empd_Empdd_Song *so;
2174 unsigned int sub = 0; 2173 unsigned int sub = 0;
2175 2174
2176 items = elm_genlist_selected_items_get(queue_list);
2177 if (!items) return; 2175 if (!items) return;
2178 l = eina_list_clone(items); 2176 l = eina_list_sort(eina_list_clone(items), 0, (Eina_Compare_Cb)queue_list_sort);
2179 l = eina_list_sort(l, 0, (Eina_Compare_Cb)queue_list_sort);
2180 EINA_LIST_FREE(l, it) 2177 EINA_LIST_FREE(l, it)
2181 { 2178 {
2182 if (hdr != elm_genlist_item_parent_get(it)) 2179 if (hdr != elm_genlist_item_parent_get(it))
@@ -2225,6 +2222,12 @@ queue_list_delete_selected(void)
2225} 2222}
2226 2223
2227static void 2224static void
2225queue_list_delete_selected(void)
2226{
2227 queue_list_delete_list(elm_genlist_selected_items_get(queue_list));
2228}
2229
2230static void
2228queue_list_delete_inverted(void) 2231queue_list_delete_inverted(void)
2229{ 2232{
2230 const Eina_List *items; 2233 const Eina_List *items;