Commit e6fb9f08 authored by Ulf Hermann's avatar Ulf Hermann Committed by Tobias Hunger

KitManager: Check availableCreationIds before asking for displayName

device factories will generally QTC_ASSERT when asked for IDs they don't
support. When asked for IDs they do support they should provide a
non-empty display name, though.

Change-Id: I1439fa7bec1791979dfdf28a6ee70e2e77ec8381
Reviewed-by: default avatarhjk <hjk@qt.io>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <tobias.hunger@qt.io>
parent 8afa7a64
......@@ -561,9 +561,11 @@ QSet<Id> KitFeatureProvider::availablePlatforms() const
QString KitFeatureProvider::displayNameForPlatform(Id id) const
{
foreach (IDeviceFactory *f, ExtensionSystem::PluginManager::getObjects<IDeviceFactory>()) {
const QString dn = f->displayNameForId(id);
if (!dn.isEmpty())
if (f->availableCreationIds().contains(id)) {
const QString dn = f->displayNameForId(id);
QTC_ASSERT(!dn.isEmpty(), continue);
return dn;
}
}
return QString();
}
......
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