Android: Improve error message for "invalid" Qt versions

AndroidQtVersion reports as invalid also if NDK or SDK are not
configured, or there are other errors in Devices > Android, so point the
user there.

Fixes: QTCREATORBUG-23058
Change-Id: Ic81d0663552769f78b0121ee3e1ddfc1f6510c11
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
This commit is contained in:
Eike Ziller
2019-10-08 13:07:06 +02:00
parent 54fefd89b8
commit 331358752c

View File

@@ -64,8 +64,15 @@ bool AndroidQtVersion::isValid() const
QString AndroidQtVersion::invalidReason() const
{
QString tmp = BaseQtVersion::invalidReason();
if (tmp.isEmpty() && qtAbis().isEmpty())
return tr("Failed to detect the ABIs used by the Qt version.");
if (tmp.isEmpty()) {
if (AndroidConfigurations::currentConfig().ndkLocation().isEmpty())
return tr("NDK is not configured in Devices > Android.");
if (AndroidConfigurations::currentConfig().sdkLocation().isEmpty())
return tr("SDK is not configured in Devices > Android.");
if (qtAbis().isEmpty())
return tr("Failed to detect the ABIs used by the Qt version. Check the settings in "
"Devices > Android for errors.");
}
return tmp;
}