Commit 1d0d25d3 authored by Christian Kandeler's avatar Christian Kandeler

QbsProjectManager: Improve run config creation.

The current code is overly simplistic, permanently flooding the "run
configurations" combo box with irrelevant entries that make it close to
unusable for even medium-sized projects.
With this patch, the irrelevant products are removed from the list as
soon as we know that they do not produce executables.

Change-Id: I606e7d17fd9eb89c8c0d91a7f41a9092193e175b
Reviewed-by: default avatarJoerg Bornemann <>
parent 186a12ec
......@@ -563,10 +563,16 @@ QList<Core::Id> QbsRunConfigurationFactory::availableCreationIds(ProjectExplorer
if (!project || !project->qbsProject().isValid())
return result;
// Create one RC per product. There is no information on what those products actually
// are or whether they are going to get installed before a project is built.
foreach (const qbs::ProductData &product, project->qbsProjectData().allProducts())
result << Core::Id::fromString(QString::fromLatin1(QBS_RC_PREFIX) +;
// Before the first build, some information regarding the target artifacts is not yet
// present. Simply create run configs for all products in that case; the irrelevant ones
// will disapear again later.
foreach (const qbs::ProductData &product, project->qbsProjectData().allProducts()) {
const bool alreadyhasTargetInfo = !product.targetArtifacts().isEmpty();
if (!alreadyhasTargetInfo || !project->qbsProject()
.targetExecutable(product, qbs::InstallOptions()).isEmpty()) {
result << Core::Id::fromString(QString::fromLatin1(QBS_RC_PREFIX) +;
return result;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment