QmlDesigner: Do not register Effects for item library

Fixes: QDS-11925
Change-Id: I981853d1c02d99cfb391209a9a7e568bf52401cf
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
Miikka Heikkinen
2024-02-08 15:34:12 +02:00
parent ca6e6e4f3e
commit b1362ddda6
3 changed files with 8 additions and 3 deletions

View File

@@ -1654,7 +1654,8 @@ void openOldEffectMaker(const QString &filePath)
Utils::FilePath projectPath = target->project()->projectDirectory();
QString effectName = QFileInfo(filePath).baseName();
QString effectResDir = QLatin1String(Constants::DEFAULT_ASSET_IMPORT_FOLDER) + "/Effects/" + effectName;
QString effectResDir = QLatin1String(Constants::DEFAULT_EFFECTS_IMPORT_FOLDER)
+ "/" + effectName;
Utils::FilePath effectResPath = projectPath.pathAppended(effectResDir);
if (!effectResPath.exists())
QDir().mkpath(effectResPath.toString());
@@ -1693,7 +1694,7 @@ void openOldEffectMaker(const QString &filePath)
Utils::FilePath getEffectsImportDirectory()
{
QString defaultDir = QLatin1String(Constants::DEFAULT_ASSET_IMPORT_FOLDER) + "/Effects";
QString defaultDir = QLatin1String(Constants::DEFAULT_EFFECTS_IMPORT_FOLDER);
Utils::FilePath projectPath = QmlDesignerPlugin::instance()->documentManager().currentProjectDirPath();
Utils::FilePath effectsPath = projectPath.pathAppended(defaultDir);

View File

@@ -344,8 +344,11 @@ void SubComponentManager::unregisterQmlFile(const QFileInfo &fileInfo, const QSt
void SubComponentManager::registerQmlFile(const QFileInfo &fileInfo, const QString &qualifier,
bool addToLibrary)
{
if (!addToLibrary || !model() || fileInfo.path().contains(QLatin1String(Constants::QUICK_3D_ASSETS_FOLDER)))
if (!addToLibrary || !model()
|| fileInfo.path().contains(QLatin1String(Constants::QUICK_3D_ASSETS_FOLDER))
|| fileInfo.path().contains(QLatin1String(Constants::DEFAULT_EFFECTS_IMPORT_FOLDER))) {
return;
}
QString componentName = fileInfo.baseName();
const QString baseComponentName = componentName;

View File

@@ -78,6 +78,7 @@ const char QUICK_3D_ASSET_IMPORT_DATA_NAME[] = "_importdata.json";
const char QUICK_3D_ASSET_IMPORT_DATA_OPTIONS_KEY[] = "import_options";
const char QUICK_3D_ASSET_IMPORT_DATA_SOURCE_KEY[] = "source_scene";
const char DEFAULT_ASSET_IMPORT_FOLDER[] = "/asset_imports";
const char DEFAULT_EFFECTS_IMPORT_FOLDER[] = "/asset_imports/Effects";
const char MATERIAL_LIB_ID[] = "__materialLibrary__";
const char MIME_TYPE_ITEM_LIBRARY_INFO[] = "application/vnd.qtdesignstudio.itemlibraryinfo";