[Patch] Fix undeleted "static QFont *_font" in kglobalsettings.cpp

Friedrich W. H. Kossebau kossebau at kde.org
Thu Dec 4 20:37:06 GMT 2008


Am Donnerstag, 4. Dezember 2008, um 20:54 Uhr, schrieb Matthias Kretz:
> On Thursday 04 December 2008 20:16:48 Thiago Macieira wrote:
> > On Thursday 04 December 2008 17:46:47 Matthias Kretz wrote:
> > > Thiago, do you have any good reason other than the name?
> >
> > Because we didn't mean it to be placed inside functions. It's called
> > K_GLOBAL_STATIC, not K_LOCAL_STATIC.
> >
> > It works, sure, but we could decide to change it to something else, which
> > may not work in a function location.
> >
> :) Then how about we add a K_LOCAL_STATIC macro that expands to
>
> K_GLOBAL_STATIC for now and be more strict wrt to the usage of the macros?

Would be nice and help with the usage to define a singleton (cmp. the typical 
self() function). Because as K_GLOBAL_STATIC  is now a constructor must be 
made public, inviting API users to misuse that for hacks.

Or could there be another macro which creates the then not anonymous struct 
name used in the K_GLOBAL_STATIC macro, which then could be used to add 
a "friend struct X;" definition to the class which should be a singleton?

Cheers
Friedrich
-- 
Okteta - KDE 4 Hex Editor - http://utils.kde.org/projects/okteta




More information about the kde-core-devel mailing list