QmlProject: Resolve import paths relative to target directory

On desktop the target directory is the same as the source directory. On
remote devices, it can be different. We need to resolve when we know
where to deploy.

Change-Id: I3f2bc088476ae73dac5231cb24f277c055f7d044
Task-number: QTCREATORBUG-19888
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Ulf Hermann
2018-02-22 10:42:13 +01:00
committed by Tim Jenssen
parent 09a7247bfc
commit 30638df441
3 changed files with 19 additions and 20 deletions

View File

@@ -47,8 +47,6 @@ void QmlProjectItem::setSourceDirectory(const QString &directoryPath)
this, &QmlProjectItem::qmlFilesChanged);
}
}
setImportPaths(m_importPaths);
}
void QmlProjectItem::setTargetDirectory(const QString &directoryPath)
@@ -60,17 +58,6 @@ void QmlProjectItem::setImportPaths(const QStringList &importPaths)
{
if (m_importPaths != importPaths)
m_importPaths = importPaths;
// convert to absolute paths
QStringList absoluteImportPaths;
const QDir sourceDir(sourceDirectory());
foreach (const QString &importPath, importPaths)
absoluteImportPaths += QDir::cleanPath(sourceDir.absoluteFilePath(importPath));
if (m_absoluteImportPaths == absoluteImportPaths)
return;
m_absoluteImportPaths = absoluteImportPaths;
}
/* Returns list of absolute paths */