Fwd: Re: Turning off screensavers [xarafaxz at nxxx: KMplayer

Koos Vriezen koos.vriezen at xs4all.nl
Thu Jan 12 21:47:41 GMT 2006

On Thursday 12 January 2006 17:25, David Faure wrote:
> On Thursday 12 January 2006 18:10, Lubos Lunak wrote:
> > class KDE_EXPORT KScreenSaver
> > {
> > public:
> >     /**
> >       * docs here
> >       */
> >     void setEnabled( bool set );
> > };

Lubos, thanks for picking this up ..

> Yes; well, namespace [or static method] if the class isn't supposed to be instanciated.

Fwiw, instanciated has the advantage that the object can restore its initials
on destruction and storing defaults (eg. create on demand in
KApplicationPrivate for 3.5).

> >  Isn't that a bit ... silly? Not that I really mind if this is really the way 
> > it's intended to be, but won't we end up with hundreds of things like this?
> Well, I wouldn't say hundreds, but all kapp->startServiceBy... have moved to KToolInvocation, for
> instance, so yes, it's intended to be classes with a particular purpose as 
> opposed to KApplication being the all-in-one mess.
> But maybe the screensaver enabling/disabling is part of a bigger set of... desktop operations?
> Right now I can't think of other similar things that app might want to do.

I think that that also makes sense for eg. changing resolution (games, TV,
etc). One other reason that an app must restore to its defaults and
maybe worth thinking about what happens if two apps interleave with
these calls ...


More information about the kde-core-devel mailing list