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:
@@ -451,7 +451,7 @@ Row {
|
|||||||
// Prefer hiding generated component files rather than other project files
|
// Prefer hiding generated component files rather than other project files
|
||||||
let listIndex = nameMap.get(item.fileName)
|
let listIndex = nameMap.get(item.fileName)
|
||||||
let absPath = comboBox.listModel.get(listIndex).absoluteFilePath
|
let absPath = comboBox.listModel.get(listIndex).absoluteFilePath
|
||||||
if (absPath.includes("/GeneratedComponents/") || absPath.includes("/asset_imports/")) {
|
if (absPath.includes("/Generated/") || absPath.includes("/asset_imports/")) {
|
||||||
comboBox.listModel.set(listIndex, {
|
comboBox.listModel.set(listIndex, {
|
||||||
absoluteFilePath: item.absoluteFilePath,
|
absoluteFilePath: item.absoluteFilePath,
|
||||||
relativeFilePath: item.relativeFilePath,
|
relativeFilePath: item.relativeFilePath,
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "UIClassName", "value": "Screen01" },
|
{ "key": "UIClassName", "value": "Screen01" },
|
||||||
|
@@ -18,7 +18,7 @@
|
|||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "UIClassName", "value": "Screen01" },
|
{ "key": "UIClassName", "value": "Screen01" },
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "UIClassName", "value": "Screen01" },
|
{ "key": "UIClassName", "value": "Screen01" },
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "UIClassName", "value": "Screen01" },
|
{ "key": "UIClassName", "value": "Screen01" },
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "UIClassName", "value": "Screen01" },
|
{ "key": "UIClassName", "value": "Screen01" },
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
||||||
|
@@ -17,7 +17,7 @@
|
|||||||
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
{ "key": "ProjectPluginName", "value": "%{ProjectName}plugin" },
|
||||||
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
{ "key": "ProjectPluginClassName", "value": "%{ProjectName}Plugin" },
|
||||||
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
{ "key": "QmlProjectFileName", "value": "%{JS: Util.fileName('%{ProjectName}', 'qmlproject')}" },
|
||||||
{ "key": "AssetDir", "value": "GeneratedComponents" },
|
{ "key": "AssetDir", "value": "Generated" },
|
||||||
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
{ "key": "ContentDir", "value": "%{ProjectName}Content" },
|
||||||
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
{ "key": "ImportModuleName", "value": "%{ProjectName}" },
|
||||||
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
{ "key": "IsQt6Project", "value": "%{JS: value('QtQuickVersion') !== '2.15' }" },
|
||||||
|
@@ -172,7 +172,11 @@ void ContentLibraryEffectsModel::loadBundle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QString bundleId = m_bundleObj.value("id").toString();
|
QString bundleType = QmlDesignerPlugin::instance()->documentManager()
|
||||||
|
.generatedComponentUtils().effectsBundleType();
|
||||||
|
|
||||||
|
// Substitute correct id to avoid issues with old bundles
|
||||||
|
m_bundleObj["id"] = bundleType.split('.').last();
|
||||||
|
|
||||||
const QJsonObject catsObj = m_bundleObj.value("categories").toObject();
|
const QJsonObject catsObj = m_bundleObj.value("categories").toObject();
|
||||||
const QStringList categories = catsObj.keys();
|
const QStringList categories = catsObj.keys();
|
||||||
@@ -191,11 +195,8 @@ void ContentLibraryEffectsModel::loadBundle()
|
|||||||
|
|
||||||
QUrl icon = QUrl::fromLocalFile(bundleDir.filePath(itemObj.value("icon").toString()));
|
QUrl icon = QUrl::fromLocalFile(bundleDir.filePath(itemObj.value("icon").toString()));
|
||||||
QString qml = itemObj.value("qml").toString();
|
QString qml = itemObj.value("qml").toString();
|
||||||
TypeName type = QLatin1String("%1.%2.%3")
|
TypeName type = QLatin1String("%1.%2")
|
||||||
.arg(QmlDesignerPlugin::instance()->documentManager()
|
.arg(bundleType, qml.chopped(4)).toLatin1(); // chopped(4): remove .qml
|
||||||
.generatedComponentUtils().componentBundlesTypePrefix(),
|
|
||||||
bundleId,
|
|
||||||
qml.chopped(4)).toLatin1(); // chopped(4): remove .qml
|
|
||||||
|
|
||||||
auto bundleItem = new ContentLibraryEffect(category, item, qml, type, icon, files);
|
auto bundleItem = new ContentLibraryEffect(category, item, qml, type, icon, files);
|
||||||
|
|
||||||
|
@@ -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 QJsonObject catsObj = m_matBundleObj.value("categories").toObject();
|
||||||
const QStringList categories = catsObj.keys();
|
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()));
|
QUrl icon = QUrl::fromLocalFile(matBundleDir.filePath(matObj.value("icon").toString()));
|
||||||
QString qml = matObj.value("qml").toString();
|
QString qml = matObj.value("qml").toString();
|
||||||
TypeName type = QLatin1String("%1.%2.%3")
|
TypeName type = QLatin1String("%1.%2")
|
||||||
.arg(QmlDesignerPlugin::instance()->documentManager()
|
.arg(bundleType, qml.chopped(4)).toLatin1(); // chopped(4): remove .qml
|
||||||
.generatedComponentUtils().componentBundlesTypePrefix(),
|
|
||||||
bundleId,
|
|
||||||
qml.chopped(4)).toLatin1(); // chopped(4): remove .qml
|
|
||||||
|
|
||||||
auto bundleMat = new ContentLibraryMaterial(category, matName, qml, type, icon, files,
|
auto bundleMat = new ContentLibraryMaterial(category, matName, qml, type, icon, files,
|
||||||
m_downloadPath, m_baseUrl);
|
m_downloadPath, m_baseUrl);
|
||||||
|
@@ -282,7 +282,7 @@ void ContentLibraryUserModel::loadMaterialBundle()
|
|||||||
auto jsonFilePath = Utils::FilePath::fromString(bundleDir.filePath("user_materials_bundle.json"));
|
auto jsonFilePath = Utils::FilePath::fromString(bundleDir.filePath("user_materials_bundle.json"));
|
||||||
if (!jsonFilePath.exists()) {
|
if (!jsonFilePath.exists()) {
|
||||||
QString jsonContent = "{\n";
|
QString jsonContent = "{\n";
|
||||||
jsonContent += " \"id\": \"UserMaterialBundle\",\n";
|
jsonContent += " \"id\": \"UserMaterials\",\n";
|
||||||
jsonContent += " \"materials\": {\n";
|
jsonContent += " \"materials\": {\n";
|
||||||
jsonContent += " }\n";
|
jsonContent += " }\n";
|
||||||
jsonContent += "}";
|
jsonContent += "}";
|
||||||
@@ -304,7 +304,10 @@ void ContentLibraryUserModel::loadMaterialBundle()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_bundleIdMaterial = m_bundleObj.value("id").toString();
|
m_bundleIdMaterial = "UserMaterials";
|
||||||
|
|
||||||
|
// Substitute correct id to avoid issues with old bundles
|
||||||
|
m_bundleObj["id"] = m_bundleIdMaterial;
|
||||||
|
|
||||||
// parse materials
|
// parse materials
|
||||||
const QJsonObject matsObj = m_bundleObj.value("materials").toObject();
|
const QJsonObject matsObj = m_bundleObj.value("materials").toObject();
|
||||||
|
@@ -23,6 +23,7 @@
|
|||||||
#include "utils3d.h"
|
#include "utils3d.h"
|
||||||
|
|
||||||
#include <designerpaths.h>
|
#include <designerpaths.h>
|
||||||
|
#include <qmldesignerplugin.h>
|
||||||
|
|
||||||
#include <coreplugin/messagebox.h>
|
#include <coreplugin/messagebox.h>
|
||||||
#include <enumeration.h>
|
#include <enumeration.h>
|
||||||
|
@@ -316,9 +316,12 @@ void ItemLibraryModel::update(Model *model)
|
|||||||
GeneratedComponentUtils compUtils = QmlDesignerPlugin::instance()->documentManager()
|
GeneratedComponentUtils compUtils = QmlDesignerPlugin::instance()->documentManager()
|
||||||
.generatedComponentUtils();
|
.generatedComponentUtils();
|
||||||
|
|
||||||
|
const QString compBundlePrefix = compUtils.componentBundlesTypePrefix();
|
||||||
QStringList excludedImports {
|
QStringList excludedImports {
|
||||||
compUtils.componentBundlesTypePrefix() + ".MaterialBundle",
|
compBundlePrefix + '.' + QLatin1String(Constants::COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE),
|
||||||
compUtils.componentBundlesTypePrefix() + ".EffectBundle"
|
compBundlePrefix + '.' + QLatin1String(Constants::COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE),
|
||||||
|
compBundlePrefix + '.' + QLatin1String(Constants::OLD_COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE),
|
||||||
|
compBundlePrefix + '.' + QLatin1String(Constants::OLD_COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE)
|
||||||
};
|
};
|
||||||
|
|
||||||
// create import sections
|
// create import sections
|
||||||
|
@@ -102,10 +102,9 @@ ChooseFromPropertyListFilter::ChooseFromPropertyListFilter(const NodeMetaInfo &i
|
|||||||
#ifdef QDS_USE_PROJECTSTORAGE
|
#ifdef QDS_USE_PROJECTSTORAGE
|
||||||
// TODO add the types here or use the module
|
// TODO add the types here or use the module
|
||||||
#else
|
#else
|
||||||
} else if (insertInfo.typeName().startsWith(
|
} else if (insertInfo.typeName().startsWith(
|
||||||
QString("%1.MaterialBundle").arg(QmlDesignerPlugin::instance()->documentManager()
|
QmlDesignerPlugin::instance()->documentManager()
|
||||||
.generatedComponentUtils().componentBundlesTypePrefix())
|
.generatedComponentUtils().materialsBundleType().toUtf8())) {
|
||||||
.toUtf8())) {
|
|
||||||
if (parentInfo.isQtQuick3DModel())
|
if (parentInfo.isQtQuick3DModel())
|
||||||
propertyList.append("materials");
|
propertyList.append("materials");
|
||||||
#endif
|
#endif
|
||||||
|
@@ -60,7 +60,10 @@ Utils::FilePath GeneratedComponentUtils::componentBundlesBasePath() const
|
|||||||
if (basePath.isEmpty())
|
if (basePath.isEmpty())
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return basePath.resolvePath(QLatin1String(Constants::COMPONENT_BUNDLES_TYPE));
|
if (basePath.endsWith(Constants::GENERATED_COMPONENTS_FOLDER))
|
||||||
|
return basePath.resolvePath(QLatin1String(Constants::COMPONENT_BUNDLES_TYPE));
|
||||||
|
|
||||||
|
return basePath.resolvePath(QLatin1String(Constants::OLD_COMPONENT_BUNDLES_TYPE));
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils::FilePath GeneratedComponentUtils::import3dBasePath() const
|
Utils::FilePath GeneratedComponentUtils::import3dBasePath() const
|
||||||
@@ -77,6 +80,32 @@ Utils::FilePath GeneratedComponentUtils::import3dBasePath() const
|
|||||||
return basePath.resolvePath(QLatin1String(Constants::QUICK_3D_COMPONENTS_FOLDER));
|
return basePath.resolvePath(QLatin1String(Constants::QUICK_3D_COMPONENTS_FOLDER));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Utils::FilePath GeneratedComponentUtils::materialBundlePath() const
|
||||||
|
{
|
||||||
|
Utils::FilePath basePath = componentBundlesBasePath();
|
||||||
|
|
||||||
|
if (basePath.isEmpty())
|
||||||
|
return {};
|
||||||
|
|
||||||
|
if (basePath.endsWith(Constants::OLD_COMPONENT_BUNDLES_TYPE))
|
||||||
|
return basePath.resolvePath(QLatin1String(Constants::OLD_COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE));
|
||||||
|
|
||||||
|
return basePath.resolvePath(QLatin1String(Constants::COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE));
|
||||||
|
}
|
||||||
|
|
||||||
|
Utils::FilePath GeneratedComponentUtils::effectBundlePath() const
|
||||||
|
{
|
||||||
|
Utils::FilePath basePath = componentBundlesBasePath();
|
||||||
|
|
||||||
|
if (basePath.isEmpty())
|
||||||
|
return {};
|
||||||
|
|
||||||
|
if (basePath.endsWith(Constants::OLD_COMPONENT_BUNDLES_TYPE))
|
||||||
|
return basePath.resolvePath(QLatin1String(Constants::OLD_COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE));
|
||||||
|
|
||||||
|
return basePath.resolvePath(QLatin1String(Constants::COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE));
|
||||||
|
}
|
||||||
|
|
||||||
bool GeneratedComponentUtils::isImport3dPath(const QString &path) const
|
bool GeneratedComponentUtils::isImport3dPath(const QString &path) const
|
||||||
{
|
{
|
||||||
return path.contains('/' + QLatin1String(Constants::OLD_QUICK_3D_ASSETS_FOLDER))
|
return path.contains('/' + QLatin1String(Constants::OLD_QUICK_3D_ASSETS_FOLDER))
|
||||||
@@ -123,7 +152,7 @@ QString GeneratedComponentUtils::componentBundlesTypePrefix() const
|
|||||||
if (basePrefix.endsWith(Constants::GENERATED_COMPONENTS_FOLDER))
|
if (basePrefix.endsWith(Constants::GENERATED_COMPONENTS_FOLDER))
|
||||||
return basePrefix + '.' + QLatin1String(Constants::COMPONENT_BUNDLES_TYPE);
|
return basePrefix + '.' + QLatin1String(Constants::COMPONENT_BUNDLES_TYPE);
|
||||||
|
|
||||||
return Constants::COMPONENT_BUNDLES_TYPE;
|
return Constants::OLD_COMPONENT_BUNDLES_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GeneratedComponentUtils::composedEffectsTypePrefix() const
|
QString GeneratedComponentUtils::composedEffectsTypePrefix() const
|
||||||
@@ -136,4 +165,24 @@ QString GeneratedComponentUtils::composedEffectsTypePrefix() const
|
|||||||
return Constants::OLD_EFFECTS_FOLDER;
|
return Constants::OLD_EFFECTS_FOLDER;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString GeneratedComponentUtils::materialsBundleType() const
|
||||||
|
{
|
||||||
|
QString basePrefix = componentBundlesTypePrefix();
|
||||||
|
|
||||||
|
if (basePrefix.endsWith(Constants::OLD_COMPONENT_BUNDLES_TYPE))
|
||||||
|
return basePrefix + '.' + QLatin1String(Constants::OLD_COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE);
|
||||||
|
|
||||||
|
return basePrefix + '.' + QLatin1String(Constants::COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString GeneratedComponentUtils::effectsBundleType() const
|
||||||
|
{
|
||||||
|
QString basePrefix = componentBundlesTypePrefix();
|
||||||
|
|
||||||
|
if (basePrefix.endsWith(Constants::OLD_COMPONENT_BUNDLES_TYPE))
|
||||||
|
return basePrefix + '.' + QLatin1String(Constants::OLD_COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE);
|
||||||
|
|
||||||
|
return basePrefix + '.' + QLatin1String(Constants::COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace QmlDesigner
|
} // namespace QmlDesigner
|
||||||
|
@@ -21,6 +21,8 @@ public:
|
|||||||
Utils::FilePath composedEffectPath(const QString &effectPath) const;
|
Utils::FilePath composedEffectPath(const QString &effectPath) const;
|
||||||
Utils::FilePath componentBundlesBasePath() const;
|
Utils::FilePath componentBundlesBasePath() const;
|
||||||
Utils::FilePath import3dBasePath() const;
|
Utils::FilePath import3dBasePath() const;
|
||||||
|
Utils::FilePath materialBundlePath() const;
|
||||||
|
Utils::FilePath effectBundlePath() const;
|
||||||
|
|
||||||
bool isImport3dPath(const QString &path) const;
|
bool isImport3dPath(const QString &path) const;
|
||||||
bool isComposedEffectPath(const QString &path) const;
|
bool isComposedEffectPath(const QString &path) const;
|
||||||
@@ -30,6 +32,8 @@ public:
|
|||||||
QString import3dTypePath() const;
|
QString import3dTypePath() const;
|
||||||
QString componentBundlesTypePrefix() const;
|
QString componentBundlesTypePrefix() const;
|
||||||
QString composedEffectsTypePrefix() const;
|
QString composedEffectsTypePrefix() const;
|
||||||
|
QString materialsBundleType() const;
|
||||||
|
QString effectsBundleType() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExternalDependenciesInterface &m_externalDependencies;
|
ExternalDependenciesInterface &m_externalDependencies;
|
||||||
|
@@ -78,8 +78,10 @@ inline constexpr char EDIT3D_SNAP_CONFIG[] = "QmlDesigner.Editor3D.SnapConfig";
|
|||||||
inline constexpr char EDIT3D_CAMERA_SPEED_CONFIG[] = "QmlDesigner.Editor3D.CameraSpeedConfig";
|
inline constexpr char EDIT3D_CAMERA_SPEED_CONFIG[] = "QmlDesigner.Editor3D.CameraSpeedConfig";
|
||||||
|
|
||||||
inline constexpr char QML_DESIGNER_SUBFOLDER[] = "/designer/";
|
inline constexpr char QML_DESIGNER_SUBFOLDER[] = "/designer/";
|
||||||
inline constexpr char COMPONENT_BUNDLES_TYPE[] = "ComponentBundles";
|
inline constexpr char COMPONENT_BUNDLES_TYPE[] = "Bundles";
|
||||||
inline constexpr char GENERATED_COMPONENTS_FOLDER[] = "GeneratedComponents";
|
inline constexpr char COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE[] = "Materials";
|
||||||
|
inline constexpr char COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE[] = "Effects";
|
||||||
|
inline constexpr char GENERATED_COMPONENTS_FOLDER[] = "Generated";
|
||||||
inline constexpr char COMPONENT_BUNDLES_ASSET_REF_FILE[] = "_asset_ref.json";
|
inline constexpr char COMPONENT_BUNDLES_ASSET_REF_FILE[] = "_asset_ref.json";
|
||||||
inline constexpr char OLD_QUICK_3D_ASSETS_FOLDER[] = "Quick3DAssets";
|
inline constexpr char OLD_QUICK_3D_ASSETS_FOLDER[] = "Quick3DAssets";
|
||||||
inline constexpr char QUICK_3D_COMPONENTS_FOLDER[] = "QtQuick3D";
|
inline constexpr char QUICK_3D_COMPONENTS_FOLDER[] = "QtQuick3D";
|
||||||
@@ -90,6 +92,9 @@ inline constexpr char QUICK_3D_ASSET_IMPORT_DATA_SOURCE_KEY[] = "source_scene";
|
|||||||
inline constexpr char OLD_ASSET_IMPORT_FOLDER[] = "asset_imports";
|
inline constexpr char OLD_ASSET_IMPORT_FOLDER[] = "asset_imports";
|
||||||
inline constexpr char OLD_EFFECTS_IMPORT_FOLDER[] = "/asset_imports/Effects";
|
inline constexpr char OLD_EFFECTS_IMPORT_FOLDER[] = "/asset_imports/Effects";
|
||||||
inline constexpr char OLD_EFFECTS_FOLDER[] = "Effects";
|
inline constexpr char OLD_EFFECTS_FOLDER[] = "Effects";
|
||||||
|
inline constexpr char OLD_COMPONENT_BUNDLES_TYPE[] = "ComponentBundles";
|
||||||
|
inline constexpr char OLD_COMPONENT_BUNDLES_MATERIAL_BUNDLE_TYPE[] = "MaterialBundle";
|
||||||
|
inline constexpr char OLD_COMPONENT_BUNDLES_EFFECT_BUNDLE_TYPE[] = "EffectBundle";
|
||||||
inline constexpr char COMPOSED_EFFECTS_TYPE[] = "ComposedEffects";
|
inline constexpr char COMPOSED_EFFECTS_TYPE[] = "ComposedEffects";
|
||||||
inline constexpr char MATERIAL_LIB_ID[] = "__materialLibrary__";
|
inline constexpr char MATERIAL_LIB_ID[] = "__materialLibrary__";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user