KIdleTime library

Dario Freddi drf54321 at gmail.com
Thu Jul 9 19:11:33 BST 2009


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. Just something like that:

connect(KIdleTime::instance(), SIGNAL(timeoutReached(int)), this, 
SLOT(beginIndexing()));
connect(KIdleTime::instance(), SIGNAL(resumingFromIdle()), this, 
SLOT(stopIndexing()));

KIdleTime::instance()->addIdleTimeout(20000); // 20 seconds, seems reasonable

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

>
> Cheers,
> Sebastian
>
> On Sunday 05 July 2009 17:30:00 Dario Freddi wrote:
> > Hello list,
> >
> > as some people, namely Aaron and somebody else who I don't recall right
> > now requested me, I am developing a library (to be eventually included in
> > kdelibs) to monitor system's idle time. it's basically a revamped and
> > polished part of powerdevil's code, that can be extremely useful
> > elsewhere, for example messaging clients and similar stuff, and maybe
> > even plasma might benefit from it.
> >
> > If you are interested in it or just looking for some API/code to review,
> > your place is playground/libs/kidle. I know, I skipped the cmake checks
> > for X stuff since I'm too lazy to import all the checks, I will add them
> > whenever the lib will move to the final destination, to avoid writing
> > useless stuff.
> >
> > I will also add a backend for Windows and Mac OS, guidance is warmly
> > welcome.
> >
> > There is a draft API doc as well, the relevant class is in kidle.h,
> > implemented as a singleton.

-- 
-------------------

Dario Freddi
KDE Developer
GPG Key Signature: 511A9A3B
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20090709/d575ba19/attachment.sig>


More information about the kde-core-devel mailing list