Can Q_GLOBAL_STATIC replace KStaticDelete ?

Matthias Kretz kretz at kde.org
Wed Jan 17 21:46:59 GMT 2007


On Wednesday 17 January 2007 21:33, David Faure wrote:
> On Wednesday 17 January 2007 19:20, Matthias Kretz wrote:
> > +    /** Data which ought to be private but isn't. @internal */
> > +    static  KGlobalStaticsList  *_globalStatics;
>
> How about making that one actually internal? No need to have it in the
> header file at all, make it file-static instead.

Right. Same goes for _staticDeleters (at least) right above it.

> I like the patch, other than that.

new patch attached. Sorry it's getting hard to track which email has the 
latest version. Latest version (from now on) at 
http://vir.homelinux.org/kglobalstatic.diff

changes:
- removed K_GLOBAL_STATIC_WITH_ARGS in favor of putting all ctor and dtor 
calls in the KGlobalStatic class so that singletons can declare there ctor 
and dtor private/protected and make KGlobalStatic<SingletonClass> a friend.
- replaced q_atomic_test_and_set_ptr with QBasicAtomicPointer::testAndSet
- moved public static variables of KGlobal into the .cpp file (making it 
file-static) where possible

-- 
________________________________________________________
Matthias Kretz (Germany)                            <><
http://Vir.homelinux.org/
MatthiasKretz at gmx.net, kretz at kde.org,
Matthias.Kretz at urz.uni-heidelberg.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kglobalstatic.diff
Type: text/x-diff
Size: 10530 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070117/6155b369/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20070117/6155b369/attachment.sig>


More information about the kde-core-devel mailing list