aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2017-11-20 11:56:19 +0100
committerhjk <hjk@qt.io>2017-11-27 07:23:17 +0000
commit1697f97aff341dbd6b314702fd25ee16a54d6965 (patch)
tree323cf32faee4b6e2e8df688a0f0f3a72a88903cf /src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
parentdbd365afe6f80d76f714f107dad31704f897b9e2 (diff)
ProjectExplorer: Register createes' base id in RunConfigurationFactory
This shifts the resposibility of creation/splitting of RunConfiguration ids into what are essentially "type ids" and "build targets" to the base implementation, possibly opening the path of abandoning the mangled ids in favor of explicitly storing their constituent parts. Take advantage of base id split in RunConfigurations for availableIds /displayNameForId and for canCreate/canRestore/canClone. Change-Id: I19fefb32757407ab5053a2ae0e5a79438659f6ec Reviewed-by: Christian Kandeler <christian.kandeler@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Filippo Cucchetto <filippocucchetto@gmail.com>
Diffstat (limited to 'src/plugins/projectexplorer/customexecutablerunconfiguration.cpp')
-rw-r--r--src/plugins/projectexplorer/customexecutablerunconfiguration.cpp37
1 files changed, 5 insertions, 32 deletions
diff --git a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
index a13e7b4e13..7f357fc774 100644
--- a/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
+++ b/src/plugins/projectexplorer/customexecutablerunconfiguration.cpp
@@ -316,44 +316,17 @@ CustomExecutableRunConfigurationFactory::CustomExecutableRunConfigurationFactory
IRunConfigurationFactory(parent)
{
setObjectName("CustomExecutableRunConfigurationFactory");
- registerRunConfiguration<CustomExecutableRunConfiguration>();
+ registerRunConfiguration<CustomExecutableRunConfiguration>(CUSTOM_EXECUTABLE_ID);
}
-bool CustomExecutableRunConfigurationFactory::canCreate(Target *parent, Core::Id id) const
+QList<QString> CustomExecutableRunConfigurationFactory::availableBuildTargets(Target *, CreationMode) const
{
- if (!canHandle(parent))
- return false;
- return id == CUSTOM_EXECUTABLE_ID;
-}
-
-bool CustomExecutableRunConfigurationFactory::canRestore(Target *parent,
- const QVariantMap &map) const
-{
- if (!canHandle(parent))
- return false;
- Core::Id id(idFromMap(map));
- return canCreate(parent, id);
-}
-
-bool CustomExecutableRunConfigurationFactory::canClone(Target *parent,
- RunConfiguration *source) const
-{
- return canCreate(parent, source->id());
-}
-
-QList<Core::Id> CustomExecutableRunConfigurationFactory::availableCreationIds(Target *parent, CreationMode mode) const
-{
- Q_UNUSED(mode)
- if (!canHandle(parent))
- return QList<Core::Id>();
- return QList<Core::Id>() << Core::Id(CUSTOM_EXECUTABLE_ID);
+ return {QString()};
}
-QString CustomExecutableRunConfigurationFactory::displayNameForId(Core::Id id) const
+QString CustomExecutableRunConfigurationFactory::displayNameForBuildTarget(const QString &) const
{
- if (id == CUSTOM_EXECUTABLE_ID)
- return tr("Custom Executable");
- return QString();
+ return tr("Custom Executable");
}
} // namespace ProjectExplorer