summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2016-05-09 17:10:01 +0900
committerThiep Ha <thiepha@gmail.com>2016-05-09 17:32:12 +0900
commit07507864ca7e383b2dbf5600f8a4d58cb687e142 (patch)
tree6574432ab1e68abe3d03b05477309a0018844311 /src
parent5ba58353f006d54f096c371e9c773d24cf4263cc (diff)
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.
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/test_dnd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bin/elementary/test_dnd.c b/src/bin/elementary/test_dnd.c
index 40c2c61c11..faeee2e78c 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)
65 Elm_Object_Item *it; 65 Elm_Object_Item *it;
66 const char *t; 66 const char *t;
67 unsigned int len = 0; 67 unsigned int len = 0;
68 int i = 0;
68 69
69 EINA_LIST_FOREACH(*items, l, it) 70 EINA_LIST_FOREACH(*items, l, it)
70 { 71 {
@@ -73,17 +74,20 @@ _drag_data_build(Eina_List **items)
73 len += strlen(t); 74 len += strlen(t);
74 } 75 }
75 76
76 drag_data = malloc(len + eina_list_count(*items) * (FILESEP_LEN + 1) + 1); 77 drag_data = malloc(len + eina_list_count(*items) * (FILESEP_LEN + 1));
77 strcpy((char *) drag_data, ""); 78 strcpy((char *) drag_data, "");
78 79
79 /* drag data in form: file://URI1\nfile://URI2\n */ 80 /* drag data in form: file://URI1\nfile://URI2 */
80 EINA_LIST_FOREACH(*items, l, it) 81 EINA_LIST_FOREACH(*items, l, it)
81 { 82 {
82 t = (char *)elm_object_item_data_get(it); 83 t = (char *)elm_object_item_data_get(it);
83 if (t) 84 if (t)
84 { 85 {
86 if (i > 0)
87 strcat((char *) drag_data, "\n");
85 strcat((char *) drag_data, FILESEP); 88 strcat((char *) drag_data, FILESEP);
86 strcat((char *) drag_data, t); 89 strcat((char *) drag_data, t);
90 i++;
87 } 91 }
88 } 92 }
89 } 93 }