KIdleTime library

Sebastian Trüg trueg at kde.org
Sat Jul 11 16:39:31 BST 2009


On Friday 10 July 2009 12:00:57 Lubos Lunak wrote:
> 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.

I agree. Any chance to add support for that to KIdleTime? Maybe making it more 
generic?

> > 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 :)





More information about the kde-core-devel mailing list