Use QFile::{encode,decode}Name to deal with QT_PLUGIN_PATH
Since it deals with paths, let's use the proper path-handling functions. Change-Id: I896d2c472dfd675e9ff247657447178702f178be Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
This commit is contained in:
parent
26e47c0353
commit
41b1fb918b
@ -2055,7 +2055,7 @@ QStringList QCoreApplication::libraryPaths()
|
||||
#else
|
||||
QLatin1Char pathSep(':');
|
||||
#endif
|
||||
QStringList paths = QString::fromLatin1(libPathEnv).split(pathSep, QString::SkipEmptyParts);
|
||||
QStringList paths = QFile::decodeName(libPathEnv).split(pathSep, QString::SkipEmptyParts);
|
||||
for (QStringList::const_iterator it = paths.constBegin(); it != paths.constEnd(); ++it) {
|
||||
QString canonicalPath = QDir(*it).canonicalPath();
|
||||
if (!canonicalPath.isEmpty()
|
||||
|
@ -955,7 +955,7 @@ void tst_QApplication::libraryPaths_qt_plugin_path()
|
||||
|
||||
// Our hook into libraryPaths() initialization: Set the QT_PLUGIN_PATH environment variable
|
||||
QString installPathPluginsDeCanon = appDirPath + QString::fromLatin1("/tmp/..");
|
||||
QByteArray ascii = installPathPluginsDeCanon.toAscii();
|
||||
QByteArray ascii = QFile::encodeName(installPathPluginsDeCanon);
|
||||
qputenv("QT_PLUGIN_PATH", ascii);
|
||||
|
||||
QVERIFY(!app.libraryPaths().contains(appDirPath + QString::fromLatin1("/tmp/..")));
|
||||
|
Loading…
Reference in New Issue
Block a user