forked from qt-creator/qt-creator
ProjectExplorer: Use ids in RunConfigFactory:: setSupportedProjectType
More similar to what build/deploy uses. Change-Id: Icf8bd7031d00a6e2831f8c1f3b1bdcaa8bf259b4 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -475,17 +475,26 @@ void IRunConfigurationFactory::setSupportedTargetDeviceTypes(const QList<Core::I
|
||||
m_supportedTargetDeviceTypes = ids;
|
||||
}
|
||||
|
||||
void IRunConfigurationFactory::addSupportedProjectType(Core::Id id)
|
||||
{
|
||||
m_supportedProjectTypes.append(id);
|
||||
}
|
||||
|
||||
bool IRunConfigurationFactory::canHandle(Target *target) const
|
||||
{
|
||||
if (m_projectTypeChecker && !m_projectTypeChecker(target->project()))
|
||||
const Project *project = target->project();
|
||||
Kit *kit = target->kit();
|
||||
|
||||
if (!project->supportsKit(kit))
|
||||
return false;
|
||||
|
||||
if (!target->project()->supportsKit(target->kit()))
|
||||
return false;
|
||||
if (!m_supportedProjectTypes.isEmpty())
|
||||
if (!m_supportedProjectTypes.contains(project->id()))
|
||||
return false;
|
||||
|
||||
if (!m_supportedTargetDeviceTypes.isEmpty())
|
||||
if (!m_supportedTargetDeviceTypes.contains(
|
||||
DeviceTypeKitInformation::deviceTypeId(target->kit())))
|
||||
DeviceTypeKitInformation::deviceTypeId(kit)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user