forked from qt-creator/qt-creator
QmlDesigner: Skip duplicate assets imported simultaneously
Since asset folder is generated from the asset filename without suffix, it is possible to select multiple assets with same filename but different suffix into the import, and they would import into the same asset directory, causing confusion and potentially broken import. Fixed by skipping duplicate assets within the same import. Change-Id: Ied825f32309b4321de7fa471cbd5ff1041e03072 Fixes: QDS-1239 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -275,6 +275,11 @@ void ItemLibraryAssetImporter::parseQuick3DAsset(const QString &file, const QVar
|
||||
|
||||
QString targetDirPath = targetDir.filePath(assetName);
|
||||
|
||||
if (outDir.exists(assetName)) {
|
||||
addWarning(tr("Skipped import of duplicate asset: \"%1\"").arg(assetName));
|
||||
return;
|
||||
}
|
||||
|
||||
if (targetDir.exists(assetName)) {
|
||||
if (!confirmAssetOverwrite(assetName)) {
|
||||
addWarning(tr("Skipped import of existing asset: \"%1\"").arg(assetName));
|
||||
|
Reference in New Issue
Block a user