forked from qt-creator/qt-creator
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 <tobias.hunger@qt.io>
This commit is contained in:
@@ -370,6 +370,18 @@ void QtOptionsPageWidget::infoAnchorClicked(const QUrl &url)
|
|||||||
QDesktopServices::openUrl(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)
|
QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const BaseQtVersion *version)
|
||||||
{
|
{
|
||||||
ValidityInfo info;
|
ValidityInfo info;
|
||||||
@@ -386,12 +398,11 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Do we have tool chain issues?
|
// Do we have tool chain issues?
|
||||||
QStringList missingToolChains;
|
QList<Abi> missingToolChains;
|
||||||
int abiCount = 0;
|
const QList<Abi> qtAbis = version->qtAbis();
|
||||||
foreach (const Abi &abi, version->qtAbis()) {
|
for (const Abi &abi : qtAbis) {
|
||||||
if (ToolChainManager::findToolChains(abi).isEmpty())
|
if (ToolChainManager::findToolChains(abi).isEmpty())
|
||||||
missingToolChains.append(abi.toString());
|
missingToolChains.append(abi);
|
||||||
++abiCount;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool useable = true;
|
bool useable = true;
|
||||||
@@ -400,16 +411,18 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
|
|||||||
warnings << tr("Display Name is not unique.");
|
warnings << tr("Display Name is not unique.");
|
||||||
|
|
||||||
if (!missingToolChains.isEmpty()) {
|
if (!missingToolChains.isEmpty()) {
|
||||||
if (missingToolChains.count() == abiCount) {
|
if (missingToolChains.count() == qtAbis.size()) {
|
||||||
// Yes, this Qt version can't be used at all!
|
// 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;
|
info.icon = m_invalidVersionIcon;
|
||||||
useable = false;
|
useable = false;
|
||||||
} else {
|
} else {
|
||||||
// Yes, some ABIs are unsupported
|
// Yes, some ABIs are unsupported
|
||||||
warnings << tr("Not all possible target environments can be supported due to missing compilers.");
|
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>")
|
info.toolTip = tr("The following ABIs are currently not supported: %1")
|
||||||
.arg(missingToolChains.join(QLatin1String("</li><li>")));
|
.arg(formatAbiHtmlList(missingToolChains));
|
||||||
info.icon = m_warningVersionIcon;
|
info.icon = m_warningVersionIcon;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user