KIdleTime library

Lubos Lunak l.lunak at suse.cz
Fri Jul 10 11:00:57 BST 2009


Dne čtvrtek 09 července 2009 20:11:33 Dario Freddi napsal(a):
> Hey Sebastian,
>
> On Thursday 09 July 2009 19:56:53 Sebastian Trüg wrote:
> > this sounds really cool. Would this be able to make the strigi service
> > only index files if nothing else is happening?
>
> Sure.

 Not quite so. The user is not all of 'else' that may be happening. If Strigi 
starts indexing after 20 seconds of user inactivity, then it may kick in e.g. 
after I start compilation and sit back to watch the output, thus actually 
starting at rather bad moments (since otherwise it might index while I'm 
typing the code, which causes much lighter CPU/IO load).

 If you really want to index mainly when nothing else is happening, you need 
to watch the system load. The user inactivity timeout may still be a nice 
addition, but I would suggest a noticeably higher timeout that would mostly 
mean that the user really is not doing anything at the moment.

> And you're good to go. Now everytime the user will be inactive for 20
> seconds, the slot beginIndexing() will be called. Just remember to call
> KIdleTime::instance()->catchNextResumeEvent(); in beginIndexing() so that
> the slot stopIndexing() will be triggered when the user comes back.
>
> 4 lines of code and it looks like a nice addition :)

-- 
Lubos Lunak
KDE developer
--------------------------------------------------------------
SUSE LINUX, s.r.o.   e-mail: l.lunak at suse.cz , l.lunak at kde.org
Lihovarska 1060/12   tel: +420 284 028 972
190 00 Prague 9      fax: +420 284 028 951
Czech Republic       http://www.suse.cz




More information about the kde-core-devel mailing list