Plasma's Drag and Drop handling

Ivan Čukić ivan.cukic+kde at gmail.com
Thu Aug 21 10:18:26 CEST 2008


Hi all,

The current way of plasma (pun intended) of handling Drag and Drop is a bit 
insufficient (IMO). We support only dragging the applets (from applet browser 
for example) and dragging the files. In the later case, according to file's 
mime type, a list of supported applets are retrieved.

I propose to add a way of handling all mime types as the mime type for applets 
is handled. So, for example, if the user selects text from an editor and 
starts dragging, he or she should be able to drop it onto the desktop (for 
example to create a notes applet).

Why have this occurred to me? Well, when I wanted to make the DnD in Lancelot 
(to drop Parts of Lancelot onto the desktop), I had to make it more 
complicated than it needed to be -
 - first generate the needed data
 - create a temporary file (with text/x-lancelotpart mime type) and write
   the data into it
 - then create a drag object that has text/uri-list mime type which points to
   the temporary file.

This approach has two disadvantages:
  - one obvious - creating a file instead of just making a drag object with
   /destination/ mime type
  - and the second is that when you drag a Lancelot part to the desktop
   you get a choice whether you want to create an Icon of it or a Lancelot
   Part. Obviously, creating an icon to a temporary file has absolutely
   no sense.

Sorry for the long mail,
Cheerio!


-- 
I am a spokesman for a better way of living
Love is the word and it can be heard
If you are young the message can be sung
? ? -- Deep Purple



More information about the Plasma-devel mailing list