forked from qt-creator/qt-creator
QmlDesigner: Tweak generated components folders
Old type names were too long, shortened various names: "GeneratedComponents" -> "Generated" "ComponentBundles" -> "Bundles" "MaterialBundle" -> "Materials" "EffectBundle" -> "Effects" "UserMaterialBundle" -> "UserMaterials" Fixes: QDS-12629 Change-Id: I3a49e57bbc8d401cadd8c5de6648c7229579d2b2 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -273,7 +273,11 @@ void ContentLibraryMaterialsModel::loadMaterialBundle(const QDir &matBundleDir)
|
||||
}
|
||||
}
|
||||
|
||||
QString bundleId = m_matBundleObj.value("id").toString();
|
||||
QString bundleType = QmlDesignerPlugin::instance()->documentManager()
|
||||
.generatedComponentUtils().materialsBundleType();
|
||||
|
||||
// Substitute correct id to avoid issues with old bundles
|
||||
m_matBundleObj["id"] = bundleType.split('.').last();
|
||||
|
||||
const QJsonObject catsObj = m_matBundleObj.value("categories").toObject();
|
||||
const QStringList categories = catsObj.keys();
|
||||
@@ -292,11 +296,8 @@ void ContentLibraryMaterialsModel::loadMaterialBundle(const QDir &matBundleDir)
|
||||
|
||||
QUrl icon = QUrl::fromLocalFile(matBundleDir.filePath(matObj.value("icon").toString()));
|
||||
QString qml = matObj.value("qml").toString();
|
||||
TypeName type = QLatin1String("%1.%2.%3")
|
||||
.arg(QmlDesignerPlugin::instance()->documentManager()
|
||||
.generatedComponentUtils().componentBundlesTypePrefix(),
|
||||
bundleId,
|
||||
qml.chopped(4)).toLatin1(); // chopped(4): remove .qml
|
||||
TypeName type = QLatin1String("%1.%2")
|
||||
.arg(bundleType, qml.chopped(4)).toLatin1(); // chopped(4): remove .qml
|
||||
|
||||
auto bundleMat = new ContentLibraryMaterial(category, matName, qml, type, icon, files,
|
||||
m_downloadPath, m_baseUrl);
|
||||
|
||||
Reference in New Issue
Block a user