Oops. I missed remove deprecated structures.
Also I attached new version of this patch.

Thank you

> -----Original Message-----
> From: Carsten Haitzler (The Rasterman) [mailto:ras...@rasterman.com]
> Sent: Monday, June 20, 2011 8:08 PM
> To: Hyoyoung Chang
> Cc: enlightenment-devel@lists.sourceforge.net
> Subject: Re: [E-devel] [patch] elm_cnp_helper - determine uri or text data
> types.
> 
> On Mon, 20 Jun 2011 16:24:00 +0900 Hyoyoung Chang
> <hyoyoung.ch...@samsung.com>
> said:
> 
> well the patches do conflict. this one i didn't put in as it conflicts
> with the
> last one i mentioned that it seemed to do the same things, but missing uri
> data
> type check.
> 
> if you want me to look at this patch - can u gen one that.. doesnt
> conflict? :)
> other patches are in :)
> 
> > Ahh, that's because I can't sure which patches are will be committed.
> >
> > So I sent three patches, it's all based on same revision.
> > ([patch] elm_cnp_helper - determine uri or text data types.
> > [patch] elm_cnp_helper - add user callback handling at text response
> > [patch] elm_cnp_helper - remove pasteimage structure)
> >
> > Each patch is different. So maybe it's bugging to commit.
> > But It's not my intend. I just wanna respect maintainers.
> >
> > PS. If same situation is happen, should I send a patch which bases on
> > previous of it?
> >
> >
> > > -----Original Message-----
> > > From: Carsten Haitzler (The Rasterman) [mailto:ras...@rasterman.com]
> > > Sent: Monday, June 20, 2011 4:10 PM
> > > To: Hyoyoung Chang
> > > Cc: enlightenment-devel@lists.sourceforge.net
> > > Subject: Re: [E-devel] [patch] elm_cnp_helper - determine uri or text
> data
> > > types.
> > >
> > > On Wed, 15 Jun 2011 20:38:19 +0900 Hyoyoung Chang
> > > <hyoyoung.ch...@samsung.com>
> > > said:
> > >
> > > it looks like cnp_rempi.patch.txt replaces cnp_uritext.patch.txt
> having a
> > > look
> > > at these. am i right? it seems some bits are missing like adding
> > > is_uri_type_data()
> > >
> > > > Dear Elementary developers.
> > > >
> > > > I've made a patch about elm_cnp_helper.
> > > > It's contains two things.
> > > >
> > > > First is remove pastedimages variable (unused variable)
> > > > Other thing is about determine type.
> > > > When a user is trying to paste data, elm_cnp_helper call
> > > > notify_handler_targets.
> > > > In notify_handler_targets, it enumerates atoms and figure out
> matching
> > > > types.
> > > > Atom types are sorted by rich types to simple types.
> > > > So if a user's trying to paste simple text type, it will match uri
> type.
> > > > Because uri type also can be a text type.
> > > > However in uri type handling functions, there are no fallback to
> text
> > > type.
> > > > This patch makes if pasting data is just text, do not pass it as a
> uri.
> > > >
> > > > Thank you.
> > > >
> > > > ----------------------------------
> > > > Hyoyoung CHANG
> > > > Engineer
> > > >
> > > > SAMSUNG ELECTRONICS, Co., Ltd.
> > > > E-mail: hyoyoung.ch...@samsung.com
> > > > ----------------------------------
> > >
> > >
> > > --
> > > ------------- Codito, ergo sum - "I code, therefore I am" ------------
> --
> > > The Rasterman (Carsten Haitzler)    ras...@rasterman.com
> >
> 
> 
> --
> ------------- Codito, ergo sum - "I code, therefore I am" --------------
> The Rasterman (Carsten Haitzler)    ras...@rasterman.com
Index: elm_cnp_helper.c
===================================================================
--- elm_cnp_helper.c    (리비전 60520)
+++ elm_cnp_helper.c    (작업 사본)
@@ -620,6 +620,29 @@
 
    return EINA_TRUE;
 }
+
+static Eina_Bool
+is_uri_type_data(Cnp_Selection *sel, Ecore_X_Event_Selection_Notify *notify)
+{
+   Ecore_X_Selection_Data *data;
+   Ecore_X_Selection_Data_Files *files;
+   char *p;
+
+   data = notify->data;
+   cnp_debug("data->format is %d %p %p\n", data->format, notify, data);
+   if (data->content == ECORE_X_SELECTION_CONTENT_FILES) return EINA_TRUE;
+   else p = (char *)data->data;
+
+   if (!p) return EINA_TRUE;
+   cnp_debug("Got %s\n", p);
+   if (strncmp(p, "file://", 7))
+     {
+        if (*p != '/') return EINA_FALSE;
+     }
+
+   return EINA_TRUE;
+}
+
 /*
  * Callback to handle a targets response on a selection request:
  * So pick the format we'd like; and then request it.
@@ -643,6 +666,11 @@
           {
              if ((atoms[j].atom == atomlist[i]) && (atoms[j].notify))
                {
+                  if ((j == CNP_ATOM_text_uri) ||
+                      (j == CNP_ATOM_text_urilist))
+                    {
+                      if(!is_uri_type_data(sel, notify)) continue;
+                    }
                   cnp_debug("Atom %s matches\n",atoms[j].name);
                   goto done;
                }
------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to