KStyle::defaultStyle() related
Aaron J. Seigo
aseigo at kde.org
Tue Nov 25 14:36:18 GMT 2008
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?
and yes, that looks sensible.
> #else
> return QString("oxygen");
> #endif
> }
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20081125/e0d07f94/attachment.sig>
More information about the kde-core-devel
mailing list