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)
|
QString QbsProfileManager::runQbsConfig(QbsConfigOp op, const QString &key, const QVariant &value)
|
||||||
{
|
{
|
||||||
Utils::QtcProcess qbsConfig;
|
QStringList args;
|
||||||
QStringList args("config");
|
|
||||||
if (QbsSettings::useCreatorSettingsDirForQbs())
|
if (QbsSettings::useCreatorSettingsDirForQbs())
|
||||||
args << "--settings-dir" << QbsSettings::qbsSettingsBaseDir();
|
args << "--settings-dir" << QbsSettings::qbsSettingsBaseDir();
|
||||||
switch (op) {
|
switch (op) {
|
||||||
@@ -242,10 +241,11 @@ QString QbsProfileManager::runQbsConfig(QbsConfigOp op, const QString &key, cons
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const Utils::FilePath qbsExe = QbsSettings::qbsExecutableFilePath();
|
const Utils::FilePath qbsConfigExe = QbsSettings::qbsConfigFilePath();
|
||||||
if (qbsExe.isEmpty() || !qbsExe.exists())
|
if (qbsConfigExe.isEmpty() || !qbsConfigExe.exists())
|
||||||
return {};
|
return {};
|
||||||
qbsConfig.setCommand({qbsExe, args});
|
Utils::QtcProcess qbsConfig;
|
||||||
|
qbsConfig.setCommand({qbsConfigExe, args});
|
||||||
qbsConfig.start();
|
qbsConfig.start();
|
||||||
if (!qbsConfig.waitForStarted(3000) || !qbsConfig.waitForFinished(5000)) {
|
if (!qbsConfig.waitForStarted(3000) || !qbsConfig.waitForFinished(5000)) {
|
||||||
Core::MessageManager::writeFlashing(
|
Core::MessageManager::writeFlashing(
|
||||||
|
@@ -87,6 +87,18 @@ FilePath QbsSettings::qbsExecutableFilePath()
|
|||||||
return candidate;
|
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()
|
QString QbsSettings::defaultInstallDirTemplate()
|
||||||
{
|
{
|
||||||
return instance().m_settings.defaultInstallDirTemplate;
|
return instance().m_settings.defaultInstallDirTemplate;
|
||||||
|
@@ -50,6 +50,7 @@ public:
|
|||||||
static QbsSettings &instance();
|
static QbsSettings &instance();
|
||||||
|
|
||||||
static Utils::FilePath qbsExecutableFilePath();
|
static Utils::FilePath qbsExecutableFilePath();
|
||||||
|
static Utils::FilePath qbsConfigFilePath();
|
||||||
static bool hasQbsExecutable();
|
static bool hasQbsExecutable();
|
||||||
static QString defaultInstallDirTemplate();
|
static QString defaultInstallDirTemplate();
|
||||||
static bool useCreatorSettingsDirForQbs();
|
static bool useCreatorSettingsDirForQbs();
|
||||||
|
Reference in New Issue
Block a user