Commit abc2742f authored by Friedemann Kleint's avatar Friedemann Kleint

QtSupport: Make error message about missing compiler more verbose

List the ABIs the Qt version has in case no compiler can be found.

Change-Id: If2c0e6052e234638b318ce1f92c255163fb68c3f
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent e6bfa276
......@@ -370,6 +370,18 @@ void QtOptionsPageWidget::infoAnchorClicked(const QUrl &url)
QDesktopServices::openUrl(url);
}
static QString formatAbiHtmlList(const QList<Abi> &abis)
{
QString result = QStringLiteral("<ul><li>");
for (int i = 0, count = abis.size(); i < count; ++i) {
if (i)
result += QStringLiteral("</li><li>");
result += abis.at(i).toString();
}
result += QStringLiteral("</li></ul>");
return result;
}
QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const BaseQtVersion *version)
{
ValidityInfo info;
......@@ -386,12 +398,11 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
}
// Do we have tool chain issues?
QStringList missingToolChains;
int abiCount = 0;
foreach (const Abi &abi, version->qtAbis()) {
QList<Abi> missingToolChains;
const QList<Abi> qtAbis = version->qtAbis();
for (const Abi &abi : qtAbis) {
if (ToolChainManager::findToolChains(abi).isEmpty())
missingToolChains.append(abi.toString());
++abiCount;
missingToolChains.append(abi);
}
bool useable = true;
......@@ -400,16 +411,18 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
warnings << tr("Display Name is not unique.");
if (!missingToolChains.isEmpty()) {
if (missingToolChains.count() == abiCount) {
if (missingToolChains.count() == qtAbis.size()) {
// Yes, this Qt version can't be used at all!
info.message = tr("No compiler can produce code for this Qt version. Please define one or more compilers.");
info.message =
tr("No compiler can produce code for this Qt version."
" Please define one or more compilers for: %1").arg(formatAbiHtmlList(qtAbis));
info.icon = m_invalidVersionIcon;
useable = false;
} else {
// Yes, some ABIs are unsupported
warnings << tr("Not all possible target environments can be supported due to missing compilers.");
info.toolTip = tr("The following ABIs are currently not supported:<ul><li>%1</li></ul>")
.arg(missingToolChains.join(QLatin1String("</li><li>")));
info.toolTip = tr("The following ABIs are currently not supported: %1")
.arg(formatAbiHtmlList(missingToolChains));
info.icon = m_warningVersionIcon;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment