forked from qt-creator/qt-creator
QmlBuildSystem: Fix absolute import paths
Task-number: QDS-12732 Change-Id: Ic299731e1bc9b98bc4da82dbb20f6a75299ce72d Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -143,8 +143,6 @@ void QmlBuildSystem::registerMenuButtons()
|
||||
//wip:
|
||||
bool QmlBuildSystem::updateProjectFile()
|
||||
{
|
||||
qDebug() << "debug#1-mainfilepath" << mainFilePath();
|
||||
|
||||
QFile file(mainFilePath().fileName().append("project-test"));
|
||||
if (!file.open(QIODevice::ReadWrite | QIODevice::Truncate)) {
|
||||
qCritical() << "Cannot open Qml Project file for editing!";
|
||||
@@ -584,7 +582,7 @@ void QmlBuildSystem::refreshFiles(const QSet<QString> & /*added*/, const QSet<QS
|
||||
QVariant QmlBuildSystem::additionalData(Utils::Id id) const
|
||||
{
|
||||
if (id == Constants::customFileSelectorsData)
|
||||
return customFileSelectors();
|
||||
return fileSelectors();
|
||||
if (id == Constants::supportedLanguagesData)
|
||||
return supportedLanguages();
|
||||
if (id == Constants::primaryLanguageData)
|
||||
@@ -597,8 +595,6 @@ QVariant QmlBuildSystem::additionalData(Utils::Id id) const
|
||||
return qt6Project();
|
||||
if (id == Constants::mainFilePath)
|
||||
return mainFilePath().toString();
|
||||
if (id == Constants::customImportPaths)
|
||||
return customImportPaths();
|
||||
if (id == Constants::canonicalProjectDir)
|
||||
return canonicalProjectDir().toString();
|
||||
return {};
|
||||
@@ -682,12 +678,7 @@ Utils::EnvironmentItems QmlBuildSystem::environment() const
|
||||
return m_projectItem->environment();
|
||||
}
|
||||
|
||||
QStringList QmlBuildSystem::customImportPaths() const
|
||||
{
|
||||
return m_projectItem->importPaths();
|
||||
}
|
||||
|
||||
QStringList QmlBuildSystem::customFileSelectors() const
|
||||
QStringList QmlBuildSystem::fileSelectors() const
|
||||
{
|
||||
return m_projectItem->fileSelectors();
|
||||
}
|
||||
@@ -732,7 +723,7 @@ QStringList QmlBuildSystem::importPaths() const
|
||||
return m_projectItem->importPaths();
|
||||
}
|
||||
|
||||
QStringList QmlBuildSystem::absoluteImportPaths()
|
||||
QStringList QmlBuildSystem::absoluteImportPaths() const
|
||||
{
|
||||
return Utils::transform<QStringList>(m_projectItem->importPaths(), [&](const QString &importPath) {
|
||||
Utils::FilePath filePath = Utils::FilePath::fromString(importPath);
|
||||
|
@@ -74,9 +74,8 @@ public:
|
||||
Utils::EnvironmentItems environment() const;
|
||||
|
||||
QStringList importPaths() const;
|
||||
QStringList absoluteImportPaths();
|
||||
QStringList customImportPaths() const;
|
||||
QStringList customFileSelectors() const;
|
||||
QStringList absoluteImportPaths() const;
|
||||
QStringList fileSelectors() const;
|
||||
|
||||
bool multilanguageSupport() const;
|
||||
QStringList supportedLanguages() const;
|
||||
|
@@ -13,7 +13,6 @@ const char customQtForMCUs[] = "CustomQtForMCUs";
|
||||
const char customQt6Project[] = "CustomQt6Project";
|
||||
|
||||
const char mainFilePath[] = "MainFilePath";
|
||||
const char customImportPaths[] = "CustomImportPaths";
|
||||
const char canonicalProjectDir[] ="CanonicalProjectDir";
|
||||
|
||||
const char enviromentLaunchedQDS[] = "QTC_LAUNCHED_QDS";
|
||||
|
@@ -97,12 +97,12 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
|
||||
|
||||
// arguments from .qmlproject file
|
||||
const QmlBuildSystem *bs = qobject_cast<QmlBuildSystem *>(target->buildSystem());
|
||||
for (const QString &importPath : bs->customImportPaths()) {
|
||||
for (const QString &importPath : bs->absoluteImportPaths()) {
|
||||
cmd.addArg("-I");
|
||||
cmd.addArg(bs->targetDirectory().pathAppended(importPath).path());
|
||||
cmd.addArg(importPath);
|
||||
}
|
||||
|
||||
for (const QString &fileSelector : bs->customFileSelectors()) {
|
||||
for (const QString &fileSelector : bs->fileSelectors()) {
|
||||
cmd.addArg("-S");
|
||||
cmd.addArg(fileSelector);
|
||||
}
|
||||
|
Reference in New Issue
Block a user