diff options
| author | Thiago Macieira <[email protected]> | 2024-12-31 16:26:39 -0300 |
|---|---|---|
| committer | Thiago Macieira <[email protected]> | 2025-01-01 14:23:05 -0300 |
| commit | db34e27f7f6ade54bfae59e5eed14c05ac508a49 (patch) | |
| tree | 92ef99f5daa6d508644118fd8290bbbde363516b /src/widgets/kernel | |
| parent | ce95c26034cc5b3ae8094c1521221e5b2f13ecfa (diff) | |
Replace qgetenv() calls converted to QString with qEnvironmentVariable()
It's slightly more efficient.
Pick-to: 6.9
Change-Id: Id5ac04fc27eee108c8e5fffd786c3d5f793a0a9d
Reviewed-by: Ahmad Samir <[email protected]>
Diffstat (limited to 'src/widgets/kernel')
| -rw-r--r-- | src/widgets/kernel/qapplication.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 37be88927e6..95e1761d3e9 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -363,8 +363,8 @@ QWidget *qt_desktopWidget = nullptr; // root window widgets */ void QApplicationPrivate::process_cmdline() { - if (styleOverride.isEmpty() && qEnvironmentVariableIsSet("QT_STYLE_OVERRIDE")) - styleOverride = QString::fromLocal8Bit(qgetenv("QT_STYLE_OVERRIDE")); + if (styleOverride.isEmpty()) + styleOverride = qEnvironmentVariable("QT_STYLE_OVERRIDE"); // process platform-indep command line if (qt_is_tty_app || !argc) @@ -1411,8 +1411,8 @@ QString QApplicationPrivate::desktopStyleKey() { #if defined(QT_BUILD_INTERNAL) // Allow auto-tests to override the desktop style - if (qEnvironmentVariableIsSet("QT_DESKTOP_STYLE_KEY")) - return QString::fromLocal8Bit(qgetenv("QT_DESKTOP_STYLE_KEY")); + if (QString env = qEnvironmentVariable("QT_DESKTOP_STYLE_KEY"); !env.isNull()) + return env; #endif // The platform theme might return a style that is not available, find |
