forked from qt-creator/qt-creator
QmlDesigner: Fix path when importing a 3D model inside a component
Fixes: QDS-6319 Change-Id: Ia9dbdf9a2d32eaf996cca2ba84e89ca8111dab1c Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -128,11 +128,9 @@ ItemLibraryAssetImportDialog::ItemLibraryAssetImportDialog(
|
|||||||
importPaths = model->importPaths();
|
importPaths = model->importPaths();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString targetDir = defaulTargetDirectory;
|
QString targetDir = QmlDesignerPlugin::instance()->documentManager().currentProjectDirPath().toString();
|
||||||
|
if (targetDir.isEmpty())
|
||||||
ProjectExplorer::Project *currentProject = ProjectExplorer::SessionManager::projectForFile(doc->fileName());
|
targetDir = defaulTargetDirectory;
|
||||||
if (currentProject)
|
|
||||||
targetDir = currentProject->projectDirectory().toString();
|
|
||||||
|
|
||||||
// Import is always done under known folder. The order of preference for folder is:
|
// Import is always done under known folder. The order of preference for folder is:
|
||||||
// 1) An existing QUICK_3D_ASSETS_FOLDER under DEFAULT_ASSET_IMPORT_FOLDER project import path
|
// 1) An existing QUICK_3D_ASSETS_FOLDER under DEFAULT_ASSET_IMPORT_FOLDER project import path
|
||||||
|
Reference in New Issue
Block a user