summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThiep Ha <thiepha@gmail.com>2015-05-12 19:58:54 +0900
committerThiep Ha <thiepha@gmail.com>2015-06-02 21:50:24 +0900
commit15be2879daf82df05e24ff84e34aaaa1025851f5 (patch)
tree3498868b61c4b292d1ba8f67708650829fce74fb
parentce7c09085e2103170180af3dcf1c3ddd0b607439 (diff)
Dnd/Wl: remove hard-coded drop accept type
Drop accept type is hard-coded and not fully supported for all types. This patch provides fixes it.
-rw-r--r--src/lib/elm_cnp.c29
1 files changed, 5 insertions, 24 deletions
diff --git a/src/lib/elm_cnp.c b/src/lib/elm_cnp.c
index 513d59f3d..7be51dab0 100644
--- a/src/lib/elm_cnp.c
+++ b/src/lib/elm_cnp.c
@@ -2978,8 +2978,6 @@ static Eina_Bool
2978_wl_vcard_receive(Wl_Cnp_Selection *sel, Ecore_Wl_Event_Selection_Data_Ready *ev) 2978_wl_vcard_receive(Wl_Cnp_Selection *sel, Ecore_Wl_Event_Selection_Data_Ready *ev)
2979{ 2979{
2980 cnp_debug("In\n"); 2980 cnp_debug("In\n");
2981 return EINA_TRUE;
2982
2983 Elm_Selection_Data ddata; 2981 Elm_Selection_Data ddata;
2984 2982
2985 if (ev->selection == ECORE_WL_SELECTION_DND) 2983 if (ev->selection == ECORE_WL_SELECTION_DND)
@@ -4141,39 +4139,22 @@ _wl_drops_accept(const char *type)
4141{ 4139{
4142 Eina_List *l; 4140 Eina_List *l;
4143 Dropable *drop; 4141 Dropable *drop;
4144 Eina_Bool will_accept = EINA_FALSE;
4145 4142
4146 EINA_LIST_FOREACH(drops, l, drop) 4143 EINA_LIST_FOREACH(drops, l, drop)
4147 { 4144 {
4148 Dropable_Cbs *cbs; 4145 Dropable_Cbs *cbs;
4149 EINA_INLIST_FOREACH(drop->cbs_list, cbs) 4146 EINA_INLIST_FOREACH(drop->cbs_list, cbs)
4150 { 4147 {
4151 switch (cbs->types) 4148 Cnp_Atom *atom = eina_hash_find(_types_hash, type);
4149 if (atom && (atom->formats & cbs->types))
4152 { 4150 {
4153 case ELM_SEL_FORMAT_TARGETS: 4151 wl_cnp_selection.requestwidget = drop->obj;
4154 case ELM_SEL_FORMAT_IMAGE: 4152 return EINA_TRUE;
4155 if ((!strncmp(type, "text/uri", 8)) ||
4156 (!strncmp(type, "image/", 6)))
4157 {
4158 wl_cnp_selection.requestwidget = drop->obj;
4159 return EINA_TRUE;
4160 }
4161 break;
4162 case ELM_SEL_FORMAT_NONE:
4163 break;
4164 case ELM_SEL_FORMAT_TEXT:
4165 break;
4166 case ELM_SEL_FORMAT_MARKUP:
4167 break;
4168 case ELM_SEL_FORMAT_VCARD:
4169 break;
4170 case ELM_SEL_FORMAT_HTML:
4171 break;
4172 } 4153 }
4173 } 4154 }
4174 } 4155 }
4175 4156
4176 return will_accept; 4157 return EINA_FALSE;
4177} 4158}
4178 4159
4179static unsigned int 4160static unsigned int