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:
Miikka Heikkinen
2024-04-30 13:39:05 +03:00
parent 8ed54cb3a8
commit 6cc8c13c7c
17 changed files with 98 additions and 32 deletions

View File

@@ -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);