summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-08 13:17:18 -0300
committerFlavio Ceolin <flavio.ceolin@gmail.com>2014-09-08 13:17:18 -0300
commit0a32e7c29d1b5371b2d546262e85eaa8c78c79eb (patch)
tree8dab7aa0bc82f7578b82fbf19bfe154cd906b0a5
parent2a722f6f23e57f9ef53ccfc5bca3e1b3fa613c58 (diff)
emixer: Better iteration over list items
-rw-r--r--src/bin/playbacks_view.c12
-rw-r--r--src/bin/sinks_view.c12
-rw-r--r--src/bin/sources_view.c12
3 files changed, 21 insertions, 15 deletions
diff --git a/src/bin/playbacks_view.c b/src/bin/playbacks_view.c
index 9455e5a..b938454 100644
--- a/src/bin/playbacks_view.c
+++ b/src/bin/playbacks_view.c
@@ -48,13 +48,15 @@ _sink_input_removed_cb(void *data, int type EINA_UNUSED,
48 struct Playbacks_View *pv = data; 48 struct Playbacks_View *pv = data;
49 Emix_Sink_Input *ev = info; 49 Emix_Sink_Input *ev = info;
50 Elm_Object_Item *item = elm_genlist_first_item_get(pv->genlist); 50 Elm_Object_Item *item = elm_genlist_first_item_get(pv->genlist);
51 if (ev == elm_object_item_data_get(item))
52 elm_object_item_del(item);
53 51
54 while ((item = elm_genlist_item_next_get(item))) 52 if (item)
55 { 53 {
56 if (ev == elm_object_item_data_get(item)) 54 do
57 elm_object_item_del(item); 55 {
56 if (ev == elm_object_item_data_get(item))
57 elm_object_item_del(item);
58 }
59 while ((item = elm_genlist_item_next_get(item)));
58 } 60 }
59 61
60 return ECORE_CALLBACK_PASS_ON; 62 return ECORE_CALLBACK_PASS_ON;
diff --git a/src/bin/sinks_view.c b/src/bin/sinks_view.c
index f5f7f67..87cf5be 100644
--- a/src/bin/sinks_view.c
+++ b/src/bin/sinks_view.c
@@ -43,13 +43,15 @@ _sink_removed_cb(void *data, int type EINA_UNUSED, void *info)
43 struct Sinks_View *sv = data; 43 struct Sinks_View *sv = data;
44 Emix_Sink *ev = info; 44 Emix_Sink *ev = info;
45 Elm_Object_Item *item = elm_genlist_first_item_get(sv->genlist); 45 Elm_Object_Item *item = elm_genlist_first_item_get(sv->genlist);
46 if (ev == elm_object_item_data_get(item))
47 elm_object_item_del(item);
48 46
49 while ((item = elm_genlist_item_next_get(item))) 47 if (item)
50 { 48 {
51 if (ev == elm_object_item_data_get(item)) 49 do
52 elm_object_item_del(item); 50 {
51 if (ev == elm_object_item_data_get(item))
52 elm_object_item_del(item);
53 }
54 while ((item = elm_genlist_item_next_get(item)));
53 } 55 }
54 56
55 return ECORE_CALLBACK_PASS_ON; 57 return ECORE_CALLBACK_PASS_ON;
diff --git a/src/bin/sources_view.c b/src/bin/sources_view.c
index 80edee2..8bd883f 100644
--- a/src/bin/sources_view.c
+++ b/src/bin/sources_view.c
@@ -43,13 +43,15 @@ _source_removed_cb(void *data, int type EINA_UNUSED, void *info)
43 struct Sources_View *sv = data; 43 struct Sources_View *sv = data;
44 Emix_Source *source = info; 44 Emix_Source *source = info;
45 Elm_Object_Item *item = elm_genlist_first_item_get(sv->genlist); 45 Elm_Object_Item *item = elm_genlist_first_item_get(sv->genlist);
46 if (source == elm_object_item_data_get(item))
47 elm_object_item_del(item);
48 46
49 while ((item = elm_genlist_item_next_get(item))) 47 if (item)
50 { 48 {
51 if (source == elm_object_item_data_get(item)) 49 do
52 elm_object_item_del(item); 50 {
51 if (source == elm_object_item_data_get(item))
52 elm_object_item_del(item);
53 }
54 while ((item = elm_genlist_item_next_get(item)));
53 } 55 }
54 56
55 return ECORE_CALLBACK_PASS_ON; 57 return ECORE_CALLBACK_PASS_ON;