dropped URL handling in containment, was: Re: How to get Akonadi notes onto Plasma?

Sebastian Kügler sebas at kde.org
Wed Oct 28 19:00:25 CET 2009


On Wednesday 28 October 2009 16:39:41 Aaron J. Seigo wrote:
>   On October 27, 2009, Sebastian Kügler wrote:
> > On Tuesday 27 October 2009 17:19:24 Aaron J. Seigo wrote:
> > >   On October 27, 2009, Sebastian Kügler wrote:
> > > > Is this something I should pursue? It sounds simple enough ...
> > >
> > > sure; i don't see any downside to it and the results could be
> > > interesting; worst case is we'd have a failed experimnt on our hands
> > > and one more way not  to do it (in the words of Edison ;) but i think
> > > this could work out very well..
> >
> > 
> > The attached patch seems to work. I've not really tested it, just
> > confirmed that it works at least in one case (emailmessage, added
> >  X-Plasma-DropUrlPatterns=akonadi:* to its desktop file) -- it's late and
> > I should sleep. If it's conceptually OK, I'll clean it up and submit it
> > to review board.
> 
> doing: 
> 
> KPluginInfo::List allApplets = KPluginInfo::fromServices(offers, "exist [X-
> Plasma-DropUrlPatterns]")
> 
> should eliminate all the entries that don't have any DropUrlPatterns
>  without  having to create and then cycle through all the plasma applets
>  installed.

Good, good. That part felt icky...

> this shouldn't be needed:
> 
>     QHash<KJob*, KPluginInfo::List> dropPlugins;
> 
> the URL can be retrieved in mimeTypeRetrieved with job->url()

We the list of plugins (not the URL, I'm retrieving that from the job indeed) for the 
following case:

- a URL is dropped
- applets matching DropUrlPatterns are found
- the TransferJob returns an error

I Didn't make it up, this happens for the akonadi case if you don't have the KIO 
akonadi slave. 

My solution is to check first if we have DropUrlPattern matches and then only clean 
up without showing a menu if 

- no applets are there for this mimetype
- no DropUrlPattern matches

So in the mechanism, I think we really need it. The overhead should be negligible, 
since the memory is cleaned up after the popupmenu exits (note: forget that cleanup 
bit in the patch). 

Does it make sense now?

> but in general it could be an interesting addition...

I think so, too.
-- 
sebas

http://www.kde.org | http://vizZzion.org | GPG Key ID: 9119 0EF9


More information about the Plasma-devel mailing list