RunnerEngine / runner exec splitting

Jordi Polo mumismo at gmail.com
Tue Mar 25 15:12:19 CET 2008


This email is inspired but unrelated with the commands SoC idea, so I open
this new thread.

Right now, the SearchContext class is able to give useful information to the
runners about the data being typed.
I think the information on SearchContext::Type (Executable, File, etc.) is
particularly interesting.
This information is used by the runners to help them match.

I think it will be very useful to expand that information to be able to make
easier decisions.
In fact, that information is already being extracted! It will be very useful
to have the information that the runners provide when the "match" method
outside the runners.

What I propose is expanding SearchContext::Type  (surely will become other
thing) to make it more generic. We have mimetypes for Files. We can have
that field to describe desktop entities. Some examples:

Type = File
Mimetype = image/jpg

Type = Command/switch

Type = Contact/email


So the runners' match method will be almost the same than now but will
encode in the Type field the result of their parsing.
So we have information about what kind of object we are dealing with.

_Why this rocks_
To start with, there is a consequence. The exec method of the runners can
change to a very different kind of beast (go away?). Most "exec" methods
right now just do simple things ( call to the browser is the most popular
action).
So, why can just be defined by a file like the servicemenu of konqueror? So,
no-developers can contribute files, adding functionality is easier, etc.

Example:
[Desktop Entry]
Type=Command/shutdown
Actions=byeWorld

[Desktop Action byeWorld]
Name=shutdown
Icon=system-shutdown
Exec= dbus #call to kworkspace shutdown

Of course having the "type" info around gives much more benefits: Actions of
the clipboard can be converted to this (eventually runners will run on the
clipboard), context (the application we are using) can be added as
information making it possible that the services are available only for some
applications (imagine what services you'll like for a sound type of file
inside Amarok and how they are different to konqueror). Eventually Nepomuk
can be used and make it more powerful. The types information can help any
keyboard commanding ...


In short:
Runners can be split between RunnersEngine that makes the parse and builds
the type and desktop files with the actions.
The info that RunnersEngines provide can be used elsewhere.

I'm waiting for comments and critics!
I still have 3 days to finish my GSoC application, I don't discard working
in this functionality.

-- 
Jordi Polo Carres
NLP laboratory - NAIST
http://www.bahasara.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/panel-devel/attachments/20080325/b63bb413/attachment.html 


More information about the Panel-devel mailing list