forked from qt-creator/qt-creator
ProjectExplorer: Add a RunConfigurationFactory::canHandle(Target *)
All RunConfiguration factories had some kind of canHandle(Target *) implementation. Centralize this notion. Change-Id: Ie24a355e857bddfd76b866859b8c7a42ffc83840 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -222,6 +222,7 @@ CMakeRunConfigurationFactory::CMakeRunConfigurationFactory(QObject *parent) :
|
||||
{
|
||||
setObjectName("CMakeRunConfigurationFactory");
|
||||
registerRunConfiguration<CMakeRunConfiguration>();
|
||||
setSupportedProjectType<CMakeProject>();
|
||||
}
|
||||
|
||||
// used to show the list of possible additons to a project, returns a list of ids
|
||||
@@ -243,13 +244,6 @@ QString CMakeRunConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
return buildTargetFromId(id);
|
||||
}
|
||||
|
||||
bool CMakeRunConfigurationFactory::canHandle(Target *parent) const
|
||||
{
|
||||
if (!parent->project()->supportsKit(parent->kit()))
|
||||
return false;
|
||||
return qobject_cast<CMakeProject *>(parent->project());
|
||||
}
|
||||
|
||||
bool CMakeRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
|
||||
{
|
||||
if (!canHandle(parent))
|
||||
|
||||
Reference in New Issue
Block a user