BareMetal: Don't assert in displayNameForId() for unknown ids

This function can be called with arbitrary ids. Follow the pattern
in other device implementations and don't choke.

Change-Id: Ica25f2d24fe673ad025883bf106fc270f27fa4fe
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
Reviewed-by: Tim Sander <tim@krieglstein.org>
This commit is contained in:
hjk
2015-12-16 13:11:46 +01:00
parent ecf3eb1d9e
commit 20d22e52df

View File

@@ -48,8 +48,7 @@ BareMetalDeviceConfigurationFactory::BareMetalDeviceConfigurationFactory(QObject
QString BareMetalDeviceConfigurationFactory::displayNameForId(Core::Id type) const
{
QTC_ASSERT(type == Constants::BareMetalOsType, return QString());
return tr("Bare Metal Device");
return type == Constants::BareMetalOsType ? tr("Bare Metal Device") : QString();
}
QList<Core::Id> BareMetalDeviceConfigurationFactory::availableCreationIds() const