gengrid: no need to loop in case of reorder mode is enabled
authorAmitesh Singh <amitesh.sh@samsung.com>
Wed, 26 Aug 2015 15:13:39 +0000 (20:43 +0530)
committerAmitesh Singh <amitesh.sh@samsung.com>
Wed, 26 Aug 2015 15:34:36 +0000 (21:04 +0530)
There is no need to loop when reorder mode is enabled. This looks
ugly and nobody wants it. This fault was introduced in 7aaa5c8d0a4a5714b4f1bf79e

This patch also fixes following crash
   1. elementary_test -to "Gengrid 2".
   2. Enable all the options available.
   3. Do reorder of item via keys.
   4. Observe segv on reordering edge items.

@fix

src/lib/elm_gengrid.c

index a863799..6fc0550 100644 (file)
@@ -3062,10 +3062,7 @@ _key_action_move(Evas_Object *obj, const char *params)
              if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_LEFT))
                {
                   if (sd->item_loop_enable)
-                    {
-                       if (_item_horizontal_loop(obj, ELM_FOCUS_RIGHT))
-                         return EINA_TRUE;
-                    }
+                    return EINA_TRUE;
                   return EINA_FALSE;
                }
              if (!sd->horizontal)
@@ -3083,10 +3080,7 @@ _key_action_move(Evas_Object *obj, const char *params)
              if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_LEFT))
                {
                   if (sd->item_loop_enable)
-                    {
-                       if (_item_horizontal_loop(obj, ELM_FOCUS_RIGHT))
-                         return EINA_TRUE;
-                    }
+                    return EINA_TRUE;
                   return EINA_FALSE;
                }
              if (!_elm_config->item_select_on_focus_disable)
@@ -3143,16 +3137,8 @@ _key_action_move(Evas_Object *obj, const char *params)
 
              if (_elm_gengrid_item_edge_check(sd->focused_item, ELM_FOCUS_RIGHT))
                {
-                  if (sd->item_loop_enable && !sd->horizontal)
-                    {
-                       if (_item_horizontal_loop(obj, ELM_FOCUS_LEFT))
-                         return EINA_TRUE;
-                    }
-                  else if (sd->item_loop_enable)
-                    {
-                       if (_item_horizontal_loop(obj, ELM_FOCUS_UP))
-                         return EINA_TRUE;
-                    }
+                  if (sd->item_loop_enable)
+                    return EINA_TRUE;
                   return EINA_FALSE;
                }
              if (!sd->horizontal)
@@ -3173,7 +3159,7 @@ _key_action_move(Evas_Object *obj, const char *params)
                     {
                        if (_item_horizontal_loop(obj, ELM_FOCUS_UP))
                          return EINA_TRUE;
-                    } 
+                    }
                }
              if (!_elm_config->item_select_on_focus_disable)
                {