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:
hjk
2017-12-08 14:50:57 +01:00
parent 7f7aa6034d
commit 4a66cae854
13 changed files with 39 additions and 31 deletions

View File

@@ -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;