<br>This email is inspired but unrelated with the commands SoC idea, so I open this new thread. <br><br>Right now, the SearchContext class is able to give useful information to the runners about the data being typed. <br>I think the information on SearchContext::Type (Executable, File, etc.) is particularly interesting. <br>
This information is used by the runners to help them match. <br><br>I think it will be very useful to expand that information to be able to make easier decisions. <br>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.<br>
<br>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:<br><br>Type = File<br>
Mimetype = image/jpg<br><br>Type = Command/switch<br><br>Type = Contact/email<br><br><br>So the runners' match method will be almost the same than now but will encode in the Type field the result of their parsing. <br>
So we have information about what kind of object we are dealing with.<br><br>_Why this rocks_<br>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).<br>
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. <br><br>Example:<br>[Desktop Entry]<br>Type=Command/shutdown<br>Actions=byeWorld<br>
<br>[Desktop Action byeWorld]<br>Name=shutdown<br>Icon=system-shutdown<br>Exec= dbus #call to kworkspace shutdown<br><br>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 ...<br>
<br><br>In short:<br>Runners can be split between RunnersEngine that makes the parse and builds the type and desktop files with the actions. <br>The info that RunnersEngines provide can be used elsewhere. <br><br>I'm waiting for comments and critics!<br>
I still have 3 days to finish my GSoC application, I don't discard working in this functionality.<br><br>-- <br>Jordi Polo Carres<br>NLP laboratory - NAIST<br><a href="http://www.bahasara.org">http://www.bahasara.org</a><br>