diff options
author | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2020-09-25 08:09:12 +0300 |
---|---|---|
committer | Tomi Korpipaa <tomi.korpipaa@qt.io> | 2020-09-28 08:57:38 +0300 |
commit | 188cfb0ad684f21f90ca11cdba1845c4fa97353a (patch) | |
tree | 30a3f4a269ff0b5cf6ab3af4c59d4c79da155dd1 /src/runtime | |
parent | 03fbc3affe36cec1f12accc3971f24e6291747c6 (diff) |
Prevent duplicates in searchPaths and reverse it
The first 3 paths in the searchPaths are for finding the other
things we need to search for, the last ones are for source paths.
Reversing the order drops the required search count in a usual case
from 4 attempts to 1 or 2.
Task-number: QT3DS-4172
Change-Id: I0d7665566be6b8a9d5e7b918f7596f70126ad958
Reviewed-by: Antti Määttä <antti.maatta@qt.io>
Reviewed-by: Janne Koskinen <janne.p.koskinen@qt.io>
Diffstat (limited to 'src/runtime')
-rw-r--r-- | src/runtime/Qt3DSApplication.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/runtime/Qt3DSApplication.cpp b/src/runtime/Qt3DSApplication.cpp index 5c6dbb7..db5d359 100644 --- a/src/runtime/Qt3DSApplication.cpp +++ b/src/runtime/Qt3DSApplication.cpp @@ -2267,9 +2267,10 @@ bool AssetHandlers::handlePresentation(SApp &app, SAssetValue &asset, bool initI CFileTools::CombineBaseAndRelative(app.GetProjectDirectory().c_str(), asset.GetSource(), thePathStr); - QDir::addSearchPath(QStringLiteral("qt3dstudio"), - QFileInfo(QString(thePathStr.c_str())) - .absoluteDir().absolutePath()); + const QString absPath = QFileInfo(QString(thePathStr.c_str())).absoluteDir().absolutePath(); + if (!QDir::searchPaths(QStringLiteral("qt3dstudio")).contains(absPath)) + QDir::addSearchPath(QStringLiteral("qt3dstudio"), absPath); + SPresentationAsset &thePresentationAsset = *asset.getDataPtr<SPresentationAsset>(); eastl::vector<SElementAttributeReference> theUIPReferences; |