forked from qt-creator/qt-creator
QbsProjectManager: Fix infinite loop on per-product build.
- Setting the QFuture result is not enough, we also need to emit the finished() signal. - Never fail silently; use soft asserts for things that shouldn't happen and compile pane output for things that can. Task-number: QBS-705 Change-Id: I4dad18c2ad573a92f2a0c5aa92b596851c56541e Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -344,29 +344,32 @@ void QbsProject::invalidate()
|
||||
prepareForParsing();
|
||||
}
|
||||
|
||||
qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts, QStringList productNames)
|
||||
qbs::BuildJob *QbsProject::build(const qbs::BuildOptions &opts, QStringList productNames,
|
||||
QString &error)
|
||||
{
|
||||
if (!qbsProject().isValid() || isParsing())
|
||||
return 0;
|
||||
if (productNames.isEmpty()) {
|
||||
return qbsProject().buildAllProducts(opts);
|
||||
} else {
|
||||
QList<qbs::ProductData> products;
|
||||
foreach (const QString &productName, productNames) {
|
||||
bool found = false;
|
||||
foreach (const qbs::ProductData &data, qbsProjectData().allProducts()) {
|
||||
if (uniqueProductName(data) == productName) {
|
||||
found = true;
|
||||
products.append(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
return 0;
|
||||
}
|
||||
QTC_ASSERT(qbsProject().isValid(), return 0);
|
||||
QTC_ASSERT(!isParsing(), return 0);
|
||||
|
||||
return qbsProject().buildSomeProducts(products, opts);
|
||||
if (productNames.isEmpty())
|
||||
return qbsProject().buildAllProducts(opts);
|
||||
|
||||
QList<qbs::ProductData> products;
|
||||
foreach (const QString &productName, productNames) {
|
||||
bool found = false;
|
||||
foreach (const qbs::ProductData &data, qbsProjectData().allProducts()) {
|
||||
if (uniqueProductName(data) == productName) {
|
||||
found = true;
|
||||
products.append(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
error = QLatin1String("Cannot build: Selected products do not exist anymore."); // TODO: Use tr() in 3.4
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return qbsProject().buildSomeProducts(products, opts);
|
||||
}
|
||||
|
||||
qbs::CleanJob *QbsProject::clean(const qbs::CleanOptions &opts)
|
||||
|
||||
Reference in New Issue
Block a user