thiep pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=07507864ca7e383b2dbf5600f8a4d58cb687e142

commit 07507864ca7e383b2dbf5600f8a4d58cb687e142
Author: Thiep Ha <thie...@gmail.com>
Date:   Mon May 9 17:10:01 2016 +0900

    elm test dnd: fix multiple items dnd
    
    When we do dnd with multiple items in genlist, gengrid in dnd test,
    the items are correctly transfered.
    It is caused by incorrect sent data.
    This patch fixes by adding new line separation between items' data.
---
 src/bin/elementary/test_dnd.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/bin/elementary/test_dnd.c b/src/bin/elementary/test_dnd.c
index 40c2c61..faeee2e 100644
--- a/src/bin/elementary/test_dnd.c
+++ b/src/bin/elementary/test_dnd.c
@@ -65,6 +65,7 @@ _drag_data_build(Eina_List **items)
         Elm_Object_Item *it;
         const char *t;
         unsigned int len = 0;
+        int i = 0;
 
         EINA_LIST_FOREACH(*items, l, it)
           {
@@ -73,17 +74,20 @@ _drag_data_build(Eina_List **items)
                len += strlen(t);
           }
 
-        drag_data = malloc(len + eina_list_count(*items) * (FILESEP_LEN + 1) + 
1);
+        drag_data = malloc(len + eina_list_count(*items) * (FILESEP_LEN + 1));
         strcpy((char *) drag_data, "");
 
-        /* drag data in form: file://URI1\nfile://URI2\n */
+        /* drag data in form: file://URI1\nfile://URI2 */
         EINA_LIST_FOREACH(*items, l, it)
           {
              t = (char *)elm_object_item_data_get(it);
              if (t)
                {
+                  if (i > 0)
+                    strcat((char *) drag_data, "\n");
                   strcat((char *) drag_data, FILESEP);
                   strcat((char *) drag_data, t);
+                  i++;
                }
           }
      }

-- 


Reply via email to