[Deskbar] History persistance



Hi list !

I've finally got around thinking about how we could store the history
and finally made a patch that implements it. (attached to this mail)

What does it do:
- Persist history (with order) across restarts of deskbar (saves at exit
and loads at startup)
- Load history only from enabled handlers

What does it not do:
- Correctly share history (each instance has its own history file). Is
that a feature or a bug ?
- Untested async handlers history items, i need reports..

So in a nutshell here is what i did:
On exit, save a tuple (text, hash, handler) where
	text, is the search term
	hash, is the result of get_hash on the match in history
	handler, is the class name of the handler of the history match

On startup, when a module is initialized:
	for each tuple in history file, compare the query for 'text' in the
module against the 'hash' in the history. if both hashes matches then
the match is stored in the history list.

That means i query each module as it is started up for saved strings in
the saved file.

Async handlers have a little more gymnastic but nothing very difficult.

If you see a basic flaw with this approach, or have feature request, or
even better a patch for my patch resolving the few problems it has, it
would be great.

Raf
PS. If nobody says anything after 2-3 days i'm going to commit this
as-is in CVS, and it will probably end up in the next release.

Merry Christmas and happy new year !




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]