forked from qt-creator/qt-creator
QmlProject: Fix import paths for code model
This fixes a regression introduced by
30638df441.
Custom import paths have to be absolute for the code model.
Change-Id: I232229fa58c3900fe684ca4529b2ed08bf93e8be
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
This commit is contained in:
committed by
Ulf Hermann
parent
f60641f3d3
commit
0474216e2f
@@ -121,17 +121,6 @@ QString QmlProjectRunConfiguration::executable() const
|
||||
return qmlscene.isEmpty() ? QString("qmlscene") : qmlscene;
|
||||
}
|
||||
|
||||
static QStringList makeAbsolute(const Utils::FileName &path, const QStringList &relativePaths)
|
||||
{
|
||||
if (path.isEmpty())
|
||||
return relativePaths;
|
||||
|
||||
const QDir baseDir(path.toString());
|
||||
return Utils::transform(relativePaths, [&baseDir](const QString &path) {
|
||||
return QDir::cleanPath(baseDir.absoluteFilePath(path));
|
||||
});
|
||||
}
|
||||
|
||||
QString QmlProjectRunConfiguration::commandLineArguments() const
|
||||
{
|
||||
// arguments in .user file
|
||||
@@ -143,7 +132,7 @@ QString QmlProjectRunConfiguration::commandLineArguments() const
|
||||
// arguments from .qmlproject file
|
||||
const QmlProject *project = static_cast<QmlProject *>(currentTarget->project());
|
||||
foreach (const QString &importPath,
|
||||
makeAbsolute(project->targetDirectory(currentTarget), project->customImportPaths())) {
|
||||
QmlProject::makeAbsolute(project->targetDirectory(currentTarget), project->customImportPaths())) {
|
||||
Utils::QtcProcess::addArg(&args, QLatin1String("-I"), osType);
|
||||
Utils::QtcProcess::addArg(&args, importPath, osType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user