GTK3 theme: simplify code

There's no need to first convert to QString and then convert back to
QByteArray.

Change-Id: Idedcf3143f44c640a9259f16e364dfe76ecf4c0d
Reviewed-by: Liang Qi <liang.qi@qt.io>
(cherry picked from commit e86a5f5f8b184562b5cde0da8882a2d8ebce84d5)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Yuhang Zhao 2022-12-15 16:18:49 +08:00 committed by Qt Cherry-pick Bot
parent cf573f97fc
commit 9fdb2b48e1

View File

@ -110,7 +110,7 @@ QGtk3Theme::QGtk3Theme()
if (qEnvironmentVariableIsEmpty("XCURSOR_SIZE")) { if (qEnvironmentVariableIsEmpty("XCURSOR_SIZE")) {
const int cursorSize = gtkSetting<gint>("gtk-cursor-theme-size"); const int cursorSize = gtkSetting<gint>("gtk-cursor-theme-size");
if (cursorSize > 0) if (cursorSize > 0)
qputenv("XCURSOR_SIZE", QString::number(cursorSize).toUtf8()); qputenv("XCURSOR_SIZE", QByteArray::number(cursorSize));
} }
if (qEnvironmentVariableIsEmpty("XCURSOR_THEME")) { if (qEnvironmentVariableIsEmpty("XCURSOR_THEME")) {
const QString cursorTheme = gtkSetting("gtk-cursor-theme-name"); const QString cursorTheme = gtkSetting("gtk-cursor-theme-name");