[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-panel-devel
Subject:    Re: 4.2 feature targets
From:       "Aaron J. Seigo" <aseigo () kde ! org>
Date:       2008-10-20 23:19:52
Message-ID: 200810201719.53180.aseigo () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


On Monday 20 October 2008, Guillaume Pothier wrote:
> 2008/10/20 Aaron J. Seigo <aseigo@kde.org>:
> > On Monday 20 October 2008, Guillaume Pothier wrote:
> >> Plasma::Corona::self()->viewportGeometry(id),
> >> we're done (we need that singleton as popupPosition can't have a ref
> >> to the corona, at least at first sight).
> >
> > a singleton isn't really possible without some nasty trickery (e.g.
> > create an object of the subclass, register it with a static method in
> > Corona ... ugh).
>
> Kephal does something like that, if I understand correctly, in the
> abstract Screens class. The constructor of Screen initializes the
> static field, and as a single instance of the concrete subclass is
> ever created, there is no problem. Or do I miss something?

no, it just means that you have to be sure to create the subclass first in your 
application which makes it not-really-a-singleton ... it is doable. just 
rather see if there's a cleaner way to do it

(btw, we used to do exactly that in very early versions of plasma =)

-- 
Aaron J. Seigo
humru othro a kohnu se
GPG Fingerprint: 8B8B 2209 0C6F 7C47 B1EA  EE75 D6B7 2EB1 A7F1 DB43

KDE core developer sponsored by Qt Software


["signature.asc" (application/pgp-signature)]

_______________________________________________
Plasma-devel mailing list
Plasma-devel@kde.org
https://mail.kde.org/mailman/listinfo/plasma-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic