ProjectExplorer: Add a IRunConfigurationFactory::addFixedBuildTarget()

To be used for "special" build targets (Custom executables etc) that do not
depend on the project. This reduces user side boiler plate in a couple of
cases and is a bit clearer than the magic {QString()} result anyway.

Change-Id: I105b6ab952981143b2abf9b218fed30cee80b648
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2017-12-12 09:17:21 +01:00
parent 63ed6321fb
commit 32f2169f77
13 changed files with 39 additions and 71 deletions

View File

@@ -38,16 +38,7 @@ QmlProjectRunConfigurationFactory::QmlProjectRunConfigurationFactory(QObject *pa
registerRunConfiguration<QmlProjectRunConfiguration>(Constants::QML_SCENE_RC_ID);
addSupportedProjectType(QmlProjectManager::Constants::QML_PROJECT_ID);
setSupportedTargetDeviceTypes({ProjectExplorer::Constants::DESKTOP_DEVICE_TYPE});
}
QList<QString> QmlProjectRunConfigurationFactory::availableBuildTargets(ProjectExplorer::Target *, CreationMode) const
{
return {QString()};
}
QString QmlProjectRunConfigurationFactory::displayNameForBuildTarget(const QString &) const
{
return tr("QML Scene");
addFixedBuildTarget(tr("QML Scene"));
}
} // namespace Internal