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

Friedrich W. H. Kossebau kossebau at kde.org
Thu Dec 4 14:07:44 GMT 2008

Hi Thiago,

thanks for reviewing.

Am Donnerstag, 4. Dezember 2008, um 14:41 Uhr, schrieb Thiago Macieira:
> On Thursday 04 December 2008 14:16:15 Friedrich W. H. Kossebau wrote:
> >         inline GlobalSettingsData* GlobalSettingsData::self()
> >         {
> >                 K_GLOBAL_STATIC(GlobalSettingsData, s_self)
> >                 return s_self;
> >         }
> Don't put K_GLOBAL_STATIC inside a function.

Okay. Was copied from KGlobalSettings::self(). Would fix it there, too. But 
hat doesn't work because the constructor is not accessible:
	globalsettings.h:601: error: ‘KGlobalSettings::KGlobalSettings()’ is private
	globalsettings.cpp:182: error: within this context
Making the constructor public is defeating the singleton property, I guess. So 
what is wrong here, how is K_GLOBAL_STATIC supposed to be used here?

> Also, your class doesn't start with a K. Please don't pollute the global
> namespace (remember that not all compilers support hidden visibility). The
> same goes for FontData.

Will do so. (Duh, up to now I have been in the believe that all classes 
without a header file do not end as symbols, so their names do not matter in 
this regard.)

Also fixed wrong calculation of size of PreferredFontNames array 
(adding /sizeof(const char*), BTW.

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

More information about the kde-core-devel mailing list