dropping content onto Plasma

Aaron J. Seigo aseigo at kde.org
Tue Mar 24 18:26:40 CET 2009


On Tuesday 24 March 2009, Sebastian Kügler wrote:
> On Tuesday 24 March 2009 14:30:41 Aaron J. Seigo wrote:
> > On Tuesday 24 March 2009, Marco Martin wrote:
> > > > The above procedure works nicely for local content, such as files.
> > > > URL's are a special kind of draggable content though. As far as I
> > > > understand, a URL doesn't have a mimetype attached, it's either data
> > > > + mimetype (+ other metainformation) or simply a URL.
> > >
> > > hmm i don't see any ways beside on dropevent on the containment trying
> > > to download the url and see what it does contain (for http the header
> > > of the response would suffice, for other urls like akonadi: i have no
> > > idea)
> >
> > for urls like akonadi and other similar special protocols we could offer
> > a "protocol interpreter" that would decide what the content is by looking
> > at the url.
>
> It *might* work, but akonadi URLs don't necessarily contain the type of the
> data (see the type parameter in my email is empty). So it doesn't really
> help a lot, although can help in some cases and I can probably the apps
> that don't provide the type in the URL fixed.

does akonadi provide any means to query what something is given a url?

> > obviously, this is pretty hard with something like http, but i
> > hope and imagine that akonadi urls are well formed and can be deduced as
> > to their content by just looking at the url.
>
> Yeah, partly. The problem is more general though ...

sometimes the general problem isn't solvable within the available constraints. 
in those cases, i've found it's useful to pick which parts of the general 
problem are solvable, redefine the requirements to match those parts and 
produce a solution. while often an 80% solution is no better than no solution, 
for problems like this it can be.

> > we don't want to build these into
> > plasma, obviously, so something in kdelibs (KMimeType?) or piggybacking
> > on the applet plugin system might be workable ...
>
> I'll have a look at KMimeType. What do you mean by piggybacking on the
> applet plugin system?

right now the drop-and-make-an-applet feature is something we use (or abuse, 
if you wish ;) the applet plugin registry for. we could something similar 
here, perhaps even providing some mechanism to run a bit of code provided by a 
plugin over a url.

sort of like a (non-threaded :) variety of runners but specifically for 
mimetypes and which return suggested applets as their match returns.

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/plasma-devel/attachments/20090324/a57a4956/attachment-0001.sig 


More information about the Plasma-devel mailing list