diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp index de36baff61a..1daf04e3c51 100644 --- a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp +++ b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp @@ -1044,15 +1044,16 @@ static QString getAssetDefaultDirectory(const QString &assetDir, const QString & { QString adjustedDefaultDirectory = defaultDirectory; - Utils::FilePath assetPath = projectFilePath(); - if (assetPath.pathAppended("content").exists()) - assetPath= assetPath.pathAppended("content"); + Utils::FilePath contentPath = projectFilePath(); - assetPath = assetPath.pathAppended(assetDir); + if (contentPath.pathAppended("content").exists()) + contentPath = contentPath.pathAppended("content"); + + Utils::FilePath assetPath = contentPath.pathAppended(assetDir); if (!assetPath.exists()) { // Create the default asset type directory if it doesn't exist - QDir dir(projectFilePath().toString()); + QDir dir(contentPath.toString()); dir.mkpath(assetDir); }