forked from qt-creator/qt-creator
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:
@@ -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 */
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
QString targetDirectory() const { return m_targetDirectory; }
|
||||
void setTargetDirectory(const QString &directoryPath);
|
||||
|
||||
QStringList importPaths() const { return m_absoluteImportPaths; }
|
||||
QStringList importPaths() const { return m_importPaths; }
|
||||
void setImportPaths(const QStringList &paths);
|
||||
|
||||
QStringList files() const;
|
||||
@@ -72,7 +72,6 @@ protected:
|
||||
QString m_sourceDirectory;
|
||||
QString m_targetDirectory;
|
||||
QStringList m_importPaths;
|
||||
QStringList m_absoluteImportPaths;
|
||||
QString m_mainFile;
|
||||
QList<Utils::EnvironmentItem> m_environment;
|
||||
QList<QmlProjectContentItem *> m_content; // content property
|
||||
|
||||
Reference in New Issue
Block a user