SearchMatch and long lived matches

Aaron J. Seigo aseigo at kde.org
Sun Mar 16 00:40:45 CET 2008


hi all...

(this may overlap with one of the given SoC projects, but maybe it's useful to 
get the design & discussion part of it out of the way right now =)

there needs to be a way to uniquely identify SearchMatches returned. given 
that each Runner is supposed to have a unique identifier itself, these only 
need to be unique per runner (with a global id of Runner::Match).

the question is how to arrive at the unique id

it is needed for a few reasons:

a) to avoid having to refresh the entire match list completely every time, 
even if some of the matches remain the same

b) to be able to learn the user's preferences over time and start to weight 
those appropriately in subsequent runs

c) to allow for future possibilities such as allowing for long lived runners 
which are then only update or invalidated rather than recreated every run 
through.


use cases for (c) could include:

a) a runner provides a HelperMatch and registers it to always exist. except 
that the user then types in something that causes that assumption to shift 
and the runner then says "invalidate match HelpfulRunner::MyHelper" causing 
it to be removed

b) WebShortcuts only matches the first few letters, e.g. "gg:". so if it 
matches that once and the delta between the last seen match and the current 
one starts at a letter further to the right, it could simply say "update 
match WebShortcuts::GoogleSearch with '$NEW_SEARCH_TERM'"


to this end, i'm proposing the following new API for SearchMatch to allow for 
a unique ID:

	QString id() const;
	void setId(const QString &id);

and replacing the current ctor with:

	SearchMatch(AbstractRunner *runner, const QString &id);

making the id "mandatory".

thoughts? ideas?

-- 
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 Trolltech
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 194 bytes
Desc: This is a digitally signed message part.
Url : http://mail.kde.org/pipermail/panel-devel/attachments/20080315/b59b5bf5/attachment.pgp 


More information about the Panel-devel mailing list