aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2018-03-23 08:00:25 +0100
committerJ-P Nurmi <jpnurmi@qt.io>2018-03-23 12:14:39 +0000
commit9529225c849ee8e697767350cbb08e5f2845681b (patch)
tree78698d74d1ebb84538d18d20c6afeb001f5e1d58
parent1f118ce85b8c29d713d2feae529ec8a71ba28048 (diff)
QQuickStyle: use local 8-bit for paths from env vars
We must not assume that paths are Latin-1 strings. Change-Id: I13814bf29c9ebb12b71e5c559843589946a7ecac Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--src/quickcontrols2/qquickstyle.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quickcontrols2/qquickstyle.cpp b/src/quickcontrols2/qquickstyle.cpp
index 3831259b..804b53fd 100644
--- a/src/quickcontrols2/qquickstyle.cpp
+++ b/src/quickcontrols2/qquickstyle.cpp
@@ -110,7 +110,7 @@ static QStringList defaultImportPathList()
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QML2_IMPORT_PATH"))) {
const QByteArray envImportPath = qgetenv("QML2_IMPORT_PATH");
- importPaths += QString::fromLatin1(envImportPath).split(QDir::listSeparator(), QString::SkipEmptyParts);
+ importPaths += QString::fromLocal8Bit(envImportPath).split(QDir::listSeparator(), QString::SkipEmptyParts);
}
importPaths += QStringLiteral("qrc:/qt-project.org/imports");
@@ -175,9 +175,9 @@ struct QQuickStyleSpec
if (style.isEmpty())
style = QGuiApplicationPrivate::styleOverride;
if (style.isEmpty())
- style = QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_STYLE"));
+ style = QString::fromLocal8Bit(qgetenv("QT_QUICK_CONTROLS_STYLE"));
if (fallbackStyle.isEmpty())
- setFallbackStyle(QString::fromLatin1(qgetenv("QT_QUICK_CONTROLS_FALLBACK_STYLE")), "QT_QUICK_CONTROLS_FALLBACK_STYLE");
+ setFallbackStyle(QString::fromLocal8Bit(qgetenv("QT_QUICK_CONTROLS_FALLBACK_STYLE")), "QT_QUICK_CONTROLS_FALLBACK_STYLE");
#if QT_CONFIG(settings)
if (style.isEmpty() || fallbackStyle.isEmpty()) {
QSharedPointer<QSettings> settings = QQuickStylePrivate::settings(QStringLiteral("Controls"));
@@ -266,7 +266,7 @@ QStringList QQuickStylePrivate::stylePaths()
QStringList paths;
if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty("QT_QUICK_CONTROLS_STYLE_PATH"))) {
const QByteArray value = qgetenv("QT_QUICK_CONTROLS_STYLE_PATH");
- paths += QString::fromLatin1(value).split(QDir::listSeparator(), QString::SkipEmptyParts);
+ paths += QString::fromLocal8Bit(value).split(QDir::listSeparator(), QString::SkipEmptyParts);
}
// built-in import paths