forked from qt-creator/qt-creator
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: hjk <hjk@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Tobias Hunger
parent
8afa7a64cc
commit
e6fb9f08db
@@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user