more on runner information types

Jordi Polo mumismo at gmail.com
Wed Apr 23 07:59:13 CEST 2008


I open a new thread as I want to address only this specific topic here.
I thought that a complex type (ontology) for the information we are dealing
with will be beneficial, but well, Aseigo convince me in the IRC last night
that it will not.

If the complex system is not used, I want to throw a couple of thoughts.

- If we stick to our current types ( 7 ) or we add a few more in the near
future, we still can get benefits from letting runners inform the manager
what types they are interested in. Mainly, we don't need to launch all the
runners but only those that apply to the type of the information. This saves
as reading all the list of runners adding all of then to the queue of jobs,
start a job, make a check to see if the runner apply, exit runner, close
job. I expect ThreadWeaver be fast and able to manage lot of small tasks but
when we have 100 runners, and only 15 will apply, not launching 85 of them
seems the best solution.
Also runners will know that the information they get is the type they wanted
to avoiding a basic check. And no strange actions will correspond to some
information when the runner writer wasn't careful (no spellchecking in
directories for instance).
So we can create a hash of list of runners or something similar when we load
them and just use the correct list (load once, use a lot).
Of course one runner can be in more than one list what make us have some
extra pointer to runner around what I think is a negligible extra use of
memory.

- Aaron argued that complex types like "bookmark from konsole" will be
specific enough for only one runner be in charge of both find it and exec it
so no need to make the type available to other runners. If something else
should apply to that type in particular, that should go to that runner (for
instance "launch with yakuake" action).
I see that and it looks like a better approach than mine.

Now an example, in a desktop we got these kinds of information:
Bookmarks from konqueror
Bookmarks from konsole
Bookmarks from krdc

We want to search for all these 3 and launch the corresponding application.
How to do it?

a.- 3 runners each of them looks for its domain specific info and make its
domain specific action. Sounds good but the bulk of the code of these
runners will be the code that opens and looks for the "term" in the
bookmarks, so we have 80%code copied between them.

b.- 1 runner for bookmarks. Currently I have that coded. Use data of the
SearchMatch as a QStringList and store the KUrl and the name of the
application it comes from. Exec according to that.

"b" looks better than "a" IMHO (I am allergic to copying code) but what will
happen when external application KThisApplicationRocks wants to create a
similar runner for its bookmarks, 80% of code copied?

Create a librunner with common utilities?

-- 
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/20080423/478a8781/attachment.html 


More information about the Panel-devel mailing list