aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hartmann <thomas.hartmann@qt.io>2022-01-13 09:55:34 +0100
committerThomas Hartmann <thomas.hartmann@qt.io>2022-01-13 11:14:40 +0000
commit92c42ef9ff6c85053417b206792f9fce4774a198 (patch)
treea1fef79a7a227d38c7c99634094ea7943f388447
parent1463c5d09ff2533ccf62ad613498f8138b0cae09 (diff)
QmlDesigner: Fix content folder location when adding assets
Task-number: QDS-5953 Change-Id: Iaa566d2ad9d528f27288c54c1cf0ff97a850dec6 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r--src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp b/src/plugins/qmldesigner/components/componentcore/modelnodeoperations.cpp
index de36baff61..1daf04e3c5 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);
}