rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=6a92cafbec67eb077226122f844a146bee8b21ab

commit 6a92cafbec67eb077226122f844a146bee8b21ab
Author: Vitalii Vorobiov <vi.vorob...@samsung.com>
Date:   Thu Mar 17 13:47:06 2016 +0200

    demo_group: program deletion should be repeated for demo's list of signals
---
 src/bin/ui/workspace/demo_group.c | 55 +++++++++++++++++++++++++++++++++++++++
 src/bin/ui/workspace/demo_group.h |  6 +++++
 src/bin/ui/workspace/workspace.c  |  1 +
 3 files changed, 62 insertions(+)

diff --git a/src/bin/ui/workspace/demo_group.c 
b/src/bin/ui/workspace/demo_group.c
index 6e0b47d..7b7f543 100644
--- a/src/bin/ui/workspace/demo_group.c
+++ b/src/bin/ui/workspace/demo_group.c
@@ -521,6 +521,36 @@ demo_group_part_add(Evas_Object *demo, Part *part)
 }
 
 static void
+_program_item_del(Elm_Object_Item *pl, Demo_Signal *part)
+{
+   Elm_Object_Item *part_item;
+   const Eina_List *part_items;
+   Demo_Signal *pr;
+
+   assert(pl != NULL);
+   assert(part != NULL);
+
+   if (!elm_genlist_item_expanded_get(pl)) return;
+
+   part_items = elm_genlist_item_subitems_get(pl);
+
+   part_item = eina_list_data_get(part_items);
+   pr = elm_object_item_data_get(part_item);
+   while (pr->prog_name != part->prog_name)
+     {
+        part_items = eina_list_next(part_items);
+        part_item = eina_list_data_get(part_items);
+        pr = elm_object_item_data_get(part_item);
+
+        assert(pr != NULL);
+     }
+   assert(part_item != NULL);
+
+   elm_object_item_del(part_item);
+   elm_genlist_item_update(pl);
+   return;
+}
+static void
 _part_item_del(Elm_Object_Item *pl, Demo_Part *part)
 {
    Elm_Object_Item *part_item;
@@ -594,6 +624,31 @@ demo_group_part_del(Evas_Object *demo, Part *part)
 }
 
 void
+demo_group_program_del(Evas_Object *demo, Eina_Stringshare *program_name)
+{
+   Part_Demo_List *pl = evas_object_data_get(demo, DEMO_GROUP_DATA);
+   Demo_Signal *demo_sig;
+   Eina_List *l;
+
+   assert(pl);
+   assert(program_name != NULL);
+
+   EINA_LIST_FOREACH(pl->signal_list, l, demo_sig)
+     {
+        if (demo_sig->prog_name == program_name)
+          {
+             pl->signal_list = eina_list_remove(pl->signal_list, demo_sig);
+             _program_item_del(pl->it_signal, demo_sig);
+             eina_stringshare_del(demo_sig->prog_name);
+             eina_stringshare_del(demo_sig->sig_name);
+             eina_stringshare_del(demo_sig->source_name);
+             free(demo_sig);
+             return;
+          }
+     }
+}
+
+void
 demo_group_demo_update(Evas_Object *demo)
 {
    Part_Demo_List *pl = evas_object_data_get(demo, DEMO_GROUP_DATA);
diff --git a/src/bin/ui/workspace/demo_group.h 
b/src/bin/ui/workspace/demo_group.h
index 84720d4..d9a120f 100644
--- a/src/bin/ui/workspace/demo_group.h
+++ b/src/bin/ui/workspace/demo_group.h
@@ -117,6 +117,12 @@ demo_group_part_del(Evas_Object *demo, Part *part);
  * @ingroup DemoGroup
  */
 void
+demo_group_program_del(Evas_Object *demo, Eina_Stringshare *program_name);
+
+/**
+ * @ingroup DemoGroup
+ */
+void
 demo_group_demo_update(Evas_Object *demo);
 
 #endif /* DEMO_GROUP_H */
diff --git a/src/bin/ui/workspace/workspace.c b/src/bin/ui/workspace/workspace.c
index 1398b3a..2b41953 100644
--- a/src/bin/ui/workspace/workspace.c
+++ b/src/bin/ui/workspace/workspace.c
@@ -1070,4 +1070,5 @@ workspace_program_del(Evas_Object *obj, Eina_Stringshare 
*program_name)
 
    gm_program_del(ap.project, wd->group, program_name);
    group_navigator_program_del(wd->group_navi, program_name);
+   demo_group_program_del(wd->demo_navi, program_name);
 }

-- 


Reply via email to