hermet pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=7eabba160c7e131858d25d9f279668679bc00c25

commit 7eabba160c7e131858d25d9f279668679bc00c25
Author: ChunEon Park <[email protected]>
Date:   Mon Jan 5 15:42:22 2015 +0900

    genilst: unselect items if the genlist select mode is display only or none.
    
    make it behavior same with elm_genlist_item_select_mode_set()
    
    @fix
---
 src/lib/elm_genlist.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/lib/elm_genlist.c b/src/lib/elm_genlist.c
index 9ee568b..4601dc4 100644
--- a/src/lib/elm_genlist.c
+++ b/src/lib/elm_genlist.c
@@ -7598,11 +7598,19 @@ _elm_genlist_item_flip_get(Eo *eo_it EINA_UNUSED, 
Elm_Gen_Item *it)
 EOLIAN static void
 _elm_genlist_select_mode_set(Eo *obj EINA_UNUSED, Elm_Genlist_Data *sd, 
Elm_Object_Select_Mode mode)
 {
-   if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
+   if ((mode >= ELM_OBJECT_SELECT_MODE_MAX) || (sd->select_mode == mode))
      return;
 
-   if (sd->select_mode != mode)
-     sd->select_mode = mode;
+   sd->select_mode = mode;
+
+   if ((sd->select_mode == ELM_OBJECT_SELECT_MODE_NONE) ||
+       (sd->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
+     {
+        Eina_List *l, *ll;
+        Elm_Gen_Item *it;
+        EINA_LIST_FOREACH_SAFE(sd->selected, l, ll, it)
+           _item_unselect(it);
+     }
 }
 
 EOLIAN static Elm_Object_Select_Mode

-- 


Reply via email to