forked from qt-creator/qt-creator
ProjectExplorer: Simplify DeployConfig::displayName*
displayNameForBuildTarget(Id) was never overloaded, so it effectively always used the base implementation that discared the id parameter. Change-Id: Ibdba3aaf79f5b2447a20cb58c3dfdca2f34ccb6e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -163,16 +163,11 @@ bool DeployConfigurationFactory::hasAvailableBuildTargets(Target *) const
|
||||
return true;
|
||||
}
|
||||
|
||||
QString DeployConfigurationFactory::displayNameForBuildTarget(const QString &) const
|
||||
QString DeployConfigurationFactory::defaultDisplayName() const
|
||||
{
|
||||
return m_defaultDisplayName;
|
||||
}
|
||||
|
||||
QString DeployConfigurationFactory::displayNameForId(Core::Id id) const
|
||||
{
|
||||
return displayNameForBuildTarget(id.suffixAfter(m_deployConfigBaseId));
|
||||
}
|
||||
|
||||
bool DeployConfigurationFactory::canHandle(Target *target) const
|
||||
{
|
||||
if (m_supportedProjectType.isValid()) {
|
||||
|
||||
@@ -82,8 +82,8 @@ public:
|
||||
|
||||
// used to show the list of possible additons to a target, returns a list of types
|
||||
QList<Core::Id> availableCreationIds(Target *parent) const;
|
||||
// used to translate the types to names to display to the user
|
||||
QString displayNameForId(Core::Id id) const;
|
||||
// the name to display to the user
|
||||
QString defaultDisplayName() const;
|
||||
|
||||
bool canCreate(Target *parent, Core::Id id) const;
|
||||
virtual DeployConfiguration *create(Target *parent, Core::Id id);
|
||||
@@ -99,7 +99,6 @@ public:
|
||||
protected:
|
||||
virtual bool canHandle(ProjectExplorer::Target *target) const;
|
||||
virtual bool hasAvailableBuildTargets(Target *parent) const;
|
||||
virtual QString displayNameForBuildTarget(const QString &buildTarget) const;
|
||||
|
||||
using DeployConfigurationCreator = std::function<DeployConfiguration *(Target *)>;
|
||||
|
||||
|
||||
@@ -369,7 +369,7 @@ void RunSettingsWidget::aboutToShowDeployMenu()
|
||||
foreach (DeployConfigurationFactory *factory, factories) {
|
||||
QList<Core::Id> ids = factory->availableCreationIds(m_target);
|
||||
foreach (Core::Id id, ids) {
|
||||
QAction *action = m_addDeployMenu->addAction(factory->displayNameForId(id));
|
||||
QAction *action = m_addDeployMenu->addAction(factory->defaultDisplayName());
|
||||
DeployFactoryAndId data = {factory, id};
|
||||
action->setData(QVariant::fromValue(data));
|
||||
connect(action, &QAction::triggered, [factory, id, this]() {
|
||||
|
||||
Reference in New Issue
Block a user