forked from qt-creator/qt-creator
make *QtVersion::warningReason() return a string list
unlike errors, warnings can accumulate Change-Id: I6632d37a39bf3467d907cfe5c44ba555b918020a Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -70,13 +70,14 @@ QString DesktopQtVersion::type() const
|
||||
return QLatin1String(QtSupport::Constants::DESKTOPQT);
|
||||
}
|
||||
|
||||
QString DesktopQtVersion::warningReason() const
|
||||
QStringList DesktopQtVersion::warningReason() const
|
||||
{
|
||||
QStringList ret;
|
||||
if (qtAbis().count() == 1 && qtAbis().first().isNull())
|
||||
return QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
|
||||
ret << QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
|
||||
return QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||
return QString();
|
||||
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> DesktopQtVersion::detectQtAbis() const
|
||||
|
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
QString type() const;
|
||||
|
||||
QString warningReason() const;
|
||||
QStringList warningReason() const;
|
||||
|
||||
QList<ProjectExplorer::Abi> detectQtAbis() const;
|
||||
|
||||
|
@@ -70,13 +70,14 @@ QString SimulatorQtVersion::type() const
|
||||
return QLatin1String(QtSupport::Constants::SIMULATORQT);
|
||||
}
|
||||
|
||||
QString SimulatorQtVersion::warningReason() const
|
||||
QStringList SimulatorQtVersion::warningReason() const
|
||||
{
|
||||
QStringList ret;
|
||||
if (qtAbis().count() == 1 && qtAbis().first().isNull())
|
||||
return QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
|
||||
ret << QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
|
||||
if (qtVersion() >= QtSupport::QtVersionNumber(4, 7, 0) && qmlviewerCommand().isEmpty())
|
||||
return QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||
return QString();
|
||||
ret << QCoreApplication::translate("QtVersion", "No qmlviewer installed.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> SimulatorQtVersion::detectQtAbis() const
|
||||
|
@@ -49,7 +49,7 @@ public:
|
||||
|
||||
QString type() const;
|
||||
|
||||
QString warningReason() const;
|
||||
QStringList warningReason() const;
|
||||
|
||||
QList<ProjectExplorer::Abi> detectQtAbis() const;
|
||||
|
||||
|
@@ -385,9 +385,9 @@ QString BaseQtVersion::invalidReason() const
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString BaseQtVersion::warningReason() const
|
||||
QStringList BaseQtVersion::warningReason() const
|
||||
{
|
||||
return QString();
|
||||
return QStringList();
|
||||
}
|
||||
|
||||
ProjectExplorer::ToolChain *BaseQtVersion::preferredToolChain(const Utils::FileName &ms) const
|
||||
|
@@ -121,7 +121,7 @@ public:
|
||||
virtual QVariantMap toMap() const;
|
||||
virtual bool isValid() const;
|
||||
virtual QString invalidReason() const;
|
||||
virtual QString warningReason() const;
|
||||
virtual QStringList warningReason() const;
|
||||
|
||||
virtual ProjectExplorer::ToolChain *preferredToolChain(const Utils::FileName &ms) const;
|
||||
|
||||
|
@@ -383,6 +383,7 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
|
||||
}
|
||||
|
||||
bool useable = true;
|
||||
QStringList warnings;
|
||||
if (!missingToolChains.isEmpty()) {
|
||||
if (missingToolChains.count() == abiCount) {
|
||||
// Yes, this Qt version can't be used at all!
|
||||
@@ -391,7 +392,7 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
|
||||
useable = false;
|
||||
} else {
|
||||
// Yes, some ABIs are unsupported
|
||||
info.message = tr("Not all possible target environments can be supported due to missing tool chains.");
|
||||
warnings << tr("Not all possible target environments can be supported due to missing tool chains.");
|
||||
info.toolTip = tr("The following ABIs are currently not supported:<ul><li>%1</li></ul>")
|
||||
.arg(missingToolChains.join(QLatin1String("</li><li>")));
|
||||
info.icon = m_warningVersionIcon;
|
||||
@@ -399,11 +400,9 @@ QtOptionsPageWidget::ValidityInfo QtOptionsPageWidget::validInformation(const Ba
|
||||
}
|
||||
|
||||
if (useable) {
|
||||
QString warning = version->warningReason();
|
||||
if (!warning.isEmpty()) {
|
||||
if (!info.message.isEmpty())
|
||||
info.message.append(QLatin1Char('\n'));
|
||||
info.message += warning;
|
||||
warnings += version->warningReason();
|
||||
if (!warnings.isEmpty()) {
|
||||
info.message = warnings.join(QLatin1String("\n"));
|
||||
info.icon = m_warningVersionIcon;
|
||||
}
|
||||
}
|
||||
|
@@ -62,11 +62,12 @@ QString EmbeddedLinuxQtVersion::type() const
|
||||
return RemoteLinux::Constants::EMBEDDED_LINUX_QT;
|
||||
}
|
||||
|
||||
QString EmbeddedLinuxQtVersion::warningReason() const
|
||||
QStringList EmbeddedLinuxQtVersion::warningReason() const
|
||||
{
|
||||
QStringList ret;
|
||||
if (qtAbis().count() == 1 && qtAbis().first().isNull())
|
||||
return QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
|
||||
return QString();
|
||||
ret << QCoreApplication::translate("QtVersion", "ABI detection failed: Make sure to use a matching tool chain when building.");
|
||||
return ret;
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::Abi> EmbeddedLinuxQtVersion::detectQtAbis() const
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
QString type() const;
|
||||
|
||||
QString warningReason() const;
|
||||
QStringList warningReason() const;
|
||||
|
||||
QList<ProjectExplorer::Abi> detectQtAbis() const;
|
||||
|
||||
|
Reference in New Issue
Block a user