From 84f75a7ffb58c07356a5178146865b59018ecef9 Mon Sep 17 00:00:00 2001 From: Samuel Ghinet Date: Wed, 3 May 2023 15:03:57 +0300 Subject: [PATCH] QmlDesigner: Fix materials download path not using the configured path In Preferences, the User can configure the download path for bundles. However, this configured the path only for the textures, while the materials kept using the hardcoded path. Task-number: QDS-9622 Change-Id: Id4ac82f899542eac5c2ce9cc51053113327aef2c Reviewed-by: Miikka Heikkinen Reviewed-by: Mahmoud Badri --- .../contentlibrary/contentlibrarymaterialsmodel.cpp | 5 +++-- .../components/contentlibrary/contentlibrarywidget.cpp | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp index 127ecb4225f..f272a4121df 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarymaterialsmodel.cpp @@ -7,6 +7,8 @@ #include "contentlibrarymaterial.h" #include "contentlibrarymaterialscategory.h" #include "contentlibrarywidget.h" + +#include #include "filedownloader.h" #include "fileextractor.h" #include "multifiledownloader.h" @@ -30,8 +32,7 @@ ContentLibraryMaterialsModel::ContentLibraryMaterialsModel(ContentLibraryWidget : QAbstractListModel(parent) , m_widget(parent) { - m_downloadPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) - + "/QtDesignStudio/bundles/Materials"; + m_downloadPath = Paths::bundlesPathSetting() + "/Materials"; m_baseUrl = QmlDesignerPlugin::settings() .value(DesignerSettingsKey::DOWNLOADABLE_BUNDLES_URL) diff --git a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp index f83fc241856..b1e7868749c 100644 --- a/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp +++ b/src/plugins/qmldesigner/components/contentlibrary/contentlibrarywidget.cpp @@ -12,6 +12,7 @@ #include "utils/fileextractor.h" #include +#include #include #include @@ -122,8 +123,7 @@ ContentLibraryWidget::ContentLibraryWidget() m_texturesUrl = m_baseUrl + "/Textures"; m_environmentsUrl = m_baseUrl + "/Environments"; - m_downloadPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation) - + "/QtDesignStudio/bundles"; + m_downloadPath = Paths::bundlesPathSetting(); loadTextureBundle();