forked from qt-creator/qt-creator
QbsProjectManager: Call qbs-config directly
It's slightly faster than going through the qbs executable first. Fixes: QTCREATORBUG-27102 Change-Id: I13297e700fed43b20e1d1185dbdfc16152584d56 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -218,8 +218,7 @@ QString QbsProfileManager::profileNameForKit(const ProjectExplorer::Kit *kit)
|
||||
|
||||
QString QbsProfileManager::runQbsConfig(QbsConfigOp op, const QString &key, const QVariant &value)
|
||||
{
|
||||
Utils::QtcProcess qbsConfig;
|
||||
QStringList args("config");
|
||||
QStringList args;
|
||||
if (QbsSettings::useCreatorSettingsDirForQbs())
|
||||
args << "--settings-dir" << QbsSettings::qbsSettingsBaseDir();
|
||||
switch (op) {
|
||||
@@ -242,10 +241,11 @@ QString QbsProfileManager::runQbsConfig(QbsConfigOp op, const QString &key, cons
|
||||
break;
|
||||
}
|
||||
}
|
||||
const Utils::FilePath qbsExe = QbsSettings::qbsExecutableFilePath();
|
||||
if (qbsExe.isEmpty() || !qbsExe.exists())
|
||||
const Utils::FilePath qbsConfigExe = QbsSettings::qbsConfigFilePath();
|
||||
if (qbsConfigExe.isEmpty() || !qbsConfigExe.exists())
|
||||
return {};
|
||||
qbsConfig.setCommand({qbsExe, args});
|
||||
Utils::QtcProcess qbsConfig;
|
||||
qbsConfig.setCommand({qbsConfigExe, args});
|
||||
qbsConfig.start();
|
||||
if (!qbsConfig.waitForStarted(3000) || !qbsConfig.waitForFinished(5000)) {
|
||||
Core::MessageManager::writeFlashing(
|
||||
|
@@ -87,6 +87,18 @@ FilePath QbsSettings::qbsExecutableFilePath()
|
||||
return candidate;
|
||||
}
|
||||
|
||||
FilePath QbsSettings::qbsConfigFilePath()
|
||||
{
|
||||
const FilePath qbsExe = qbsExecutableFilePath();
|
||||
if (!qbsExe.isExecutableFile())
|
||||
return {};
|
||||
const FilePath qbsConfig = qbsExe.absolutePath().pathAppended("qbs-config")
|
||||
.withExecutableSuffix();
|
||||
if (!qbsConfig.isExecutableFile())
|
||||
return {};
|
||||
return qbsConfig;
|
||||
}
|
||||
|
||||
QString QbsSettings::defaultInstallDirTemplate()
|
||||
{
|
||||
return instance().m_settings.defaultInstallDirTemplate;
|
||||
|
@@ -50,6 +50,7 @@ public:
|
||||
static QbsSettings &instance();
|
||||
|
||||
static Utils::FilePath qbsExecutableFilePath();
|
||||
static Utils::FilePath qbsConfigFilePath();
|
||||
static bool hasQbsExecutable();
|
||||
static QString defaultInstallDirTemplate();
|
||||
static bool useCreatorSettingsDirForQbs();
|
||||
|
Reference in New Issue
Block a user