diff options
author | Daniel Zaoui <daniel.zaoui@samsung.com> | 2015-06-23 15:57:02 +0300 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2015-06-23 15:57:02 +0300 |
commit | 42beb36d041a4b1d3a91f8eff76d5908e2f92d58 (patch) | |
tree | 4a242f0e098963678292e436d77de6d075d24a43 | |
parent | d4f27b9126675a969833793cd6b28c5c007da797 (diff) | |
download | elementary-42beb36d041a4b1d3a91f8eff76d5908e2f92d58.tar.gz |
DnD: remove from elm_cnp code specific to elm_entry
The tag insertion has to be done only from elm_entry callback. elm_cnp
is not supposed to know what will be done with the data.
-rw-r--r-- | src/lib/elm_cnp.c | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c index 3a3bb531d..f03a0dea1 100644 --- a/src/lib/elm_cnp.c +++ b/src/lib/elm_cnp.c @@ -1621,9 +1621,6 @@ found: savedtypes.imgfile); if (savedtypes.imgfile) { - char *entrytag; - static const char *tagstring = - "<item absize=240x180 href=file://%s></item>"; ddata.x = savedtypes.x; ddata.y = savedtypes.y; ddata.action = act; @@ -1631,25 +1628,12 @@ found: EINA_INLIST_FOREACH_SAFE(dropable->cbs_list, itr, cbs) { /* If it's markup that also supports images */ - if ((cbs->types & ELM_SEL_FORMAT_MARKUP) && - (cbs->types & ELM_SEL_FORMAT_IMAGE)) - { - int len; - ddata.format = ELM_SEL_FORMAT_MARKUP; - - len = strlen(tagstring) + strlen(savedtypes.imgfile); - entrytag = alloca(len + 1); - snprintf(entrytag, len + 1, tagstring, savedtypes.imgfile); - ddata.data = entrytag; - cnp_debug("Insert %s\n", (char *)ddata.data); - if ((cbs->types & dropable->last.format) && cbs->dropcb) - cbs->dropcb(cbs->dropdata, dropable->obj, &ddata); - } - else if (cbs->types & ELM_SEL_FORMAT_IMAGE) + if (cbs->types & ELM_SEL_FORMAT_IMAGE) { cnp_debug("Doing image insert (%s)\n", savedtypes.imgfile); ddata.format = ELM_SEL_FORMAT_IMAGE; ddata.data = (char *)savedtypes.imgfile; + ddata.len = strlen(ddata.data); if ((cbs->types & dropable->last.format) && cbs->dropcb) cbs->dropcb(cbs->dropdata, dropable->obj, &ddata); } |