From 9d9822b1f8ddf341cfad9fdb09970aeb6f5064c0 Mon Sep 17 00:00:00 2001 From: Hyoyoung Chang Date: Fri, 7 Jan 2011 10:51:31 +0900 Subject: [PATCH] [cnp_helper] change img href from tag to filename --- src/lib/elm_cnp_helper.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/elm_cnp_helper.c b/src/lib/elm_cnp_helper.c index a7d3780..14fdea5 100644 --- a/src/lib/elm_cnp_helper.c +++ b/src/lib/elm_cnp_helper.c @@ -1117,7 +1117,8 @@ pasteimage_provider_set(Evas_Object *entry) static Eina_Bool pasteimage_append(Paste_Image *pi, Evas_Object *entry) { - char entrytag[100]; + char *entrytag; + char *tagstring = ""; if (!pi) return EINA_FALSE; if (!entry) return EINA_FALSE; @@ -1125,8 +1126,8 @@ pasteimage_append(Paste_Image *pi, Evas_Object *entry) pasteimage_provider_set(entry); pastedimages = eina_list_append(pastedimages, pi); - snprintf(entrytag, sizeof(entrytag), - "", pi->tag); + entrytag = alloca(sizeof(char)*(strlen(tagstring)+strlen(pi->file)+1)); + snprintf(entrytag, (strlen(tagstring)+strlen(pi->file)), tagstring, pi->file); elm_entry_entry_insert(entry, entrytag); return EINA_TRUE; @@ -1347,7 +1348,8 @@ found: cnp_debug("We found a URI... (%scached)\n", savedtypes.pi ? "" : "not "); if (savedtypes.pi) { - char entrytag[100]; + char *entrytag; + char *tagstring = ""; ddata.x = savedtypes.x; ddata.y = savedtypes.y; @@ -1371,9 +1373,9 @@ found: pasteimage_provider_set(dropable->obj); pastedimages = eina_list_append(pastedimages, savedtypes.pi); - snprintf(entrytag, sizeof(entrytag), - "", - savedtypes.pi->tag); + entrytag = alloca(sizeof(char)*(strlen(tagstring)+strlen(savedtypes.pi->file)+1)); + snprintf(entrytag, (strlen(tagstring)+strlen(savedtypes.pi->file)), + tagstring, savedtypes.pi->file); ddata.data = entrytag; cnp_debug("Insert %s\n", (char *)ddata.data); dropable->dropcb(dropable->cbdata, dropable->obj, &ddata); -- 2.7.4