KStyle::defaultStyle() related

Ralf Habacker ralf.habacker at freenet.de
Tue Nov 25 15:08:17 GMT 2008


Aaron J. Seigo schrieb:
> On Tuesday 25 November 2008, Ralf Habacker wrote:
>   
>> Hi,
>>
>> in kdelibs/kdeui/kernel/kglobalsettings.cpp there is the following code
>> snippet
>>
>> void KGlobalSettings::Private::applyGUIStyle()
>> {
>>     const QLatin1String
>> currentStyleName(qApp->style()->metaObject()->className());
>>
>>     if (kde_overrideStyle.isEmpty()) {
>> #ifdef Q_WS_X11
>>         const QString &defaultStyle = KStyle::defaultStyle();
>> #else
>>         const QString defaultStyle; // Mac, Windows: no change for style
>> by default
>> #endif
>>         const KConfigGroup pConfig(KGlobal::config(), "General");
>>         const QString &styleStr = pConfig.readEntry("widgetStyle",
>> defaultStyle);
>> ...
>>
>> This code seems to me a special hack for non x11 platforms to be able to
>> use a "native" default style, which is not supported by the recent
>> implementation of KStyle:defaultStyle(), which is hardcoded to "oxygen".
>> Would it not make the code clearer to extend KStyle::defaultStyle() with
>> the platform related native style like shown below ?
>>
>>  QString KStyle::defaultStyle()
>>  {
>> #ifndef Q_WS_X11
>>      return QString(""); // native
>>     
>
> just "return QString();" should be enough, no?
>   
of course :-)
> and yes, that looks sensible.
>
>   
Thanks, I will apply a related patch to trunk.

Ralf






More information about the kde-core-devel mailing list