Standardize RunConfiguration id specification

Use the cheapest of all patterns used so far, they are only used exactly
once.

Normalizing the id values to a common patters is not as simple as they are
stored in .user files.

Change-Id: Ib4d037a88a7a5ca2ea94dfb3933d17122c89240f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-12-11 13:49:29 +01:00
parent 97edfa7b58
commit c654677bf7
12 changed files with 6 additions and 26 deletions

View File

@@ -55,8 +55,6 @@ BareMetalCustomRunConfiguration::BareMetalCustomRunConfiguration(Target *target,
setDefaultDisplayName(RunConfigurationFactory::decoratedTargetName(tr("Custom Executable"), target));
}
const char *BareMetalCustomRunConfiguration::Id = "BareMetal";
Tasks BareMetalCustomRunConfiguration::checkForIssues() const
{
Tasks tasks;
@@ -72,7 +70,7 @@ Tasks BareMetalCustomRunConfiguration::checkForIssues() const
BareMetalCustomRunConfigurationFactory::BareMetalCustomRunConfigurationFactory()
: FixedRunConfigurationFactory(BareMetalCustomRunConfiguration::tr("Custom Executable"), true)
{
registerRunConfiguration<BareMetalCustomRunConfiguration>(BareMetalCustomRunConfiguration::Id);
registerRunConfiguration<BareMetalCustomRunConfiguration>("BareMetal");
addSupportedTargetDeviceType(BareMetal::Constants::BareMetalOsType);
}

View File

@@ -41,7 +41,6 @@ public:
explicit BareMetalCustomRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
public:
static const char *Id;
ProjectExplorer::Tasks checkForIssues() const final;
};

View File

@@ -59,13 +59,11 @@ BareMetalRunConfiguration::BareMetalRunConfiguration(Target *target, Core::Id id
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
}
const char *BareMetalRunConfiguration::IdPrefix = "BareMetalCustom";
// BareMetalRunConfigurationFactory
BareMetalRunConfigurationFactory::BareMetalRunConfigurationFactory()
{
registerRunConfiguration<BareMetalRunConfiguration>(BareMetalRunConfiguration::IdPrefix);
registerRunConfiguration<BareMetalRunConfiguration>("BareMetalCustom");
setDecorateDisplayNames(true);
addSupportedTargetDeviceType(BareMetal::Constants::BareMetalOsType);
}

View File

@@ -38,8 +38,6 @@ class BareMetalRunConfiguration final : public ProjectExplorer::RunConfiguration
public:
explicit BareMetalRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
static const char *IdPrefix;
};
// BareMetalRunConfigurationFactory

View File

@@ -36,7 +36,6 @@ const char QdbDeployConfigurationId[] = "Qt4ProjectManager.Qdb.QdbDeployConfigur
const Core::Id QdbHardwareDevicePrefix = "QdbHardwareDevice";
const char AppcontrollerFilepath[] = "/usr/bin/appcontroller";
const char QdbRunConfigurationPrefix[] = "QdbLinuxRunConfiguration:";
} // namespace Constants

View File

@@ -119,7 +119,7 @@ QString QdbRunConfiguration::defaultDisplayName() const
QdbRunConfigurationFactory::QdbRunConfigurationFactory()
{
registerRunConfiguration<QdbRunConfiguration>(Qdb::Constants::QdbRunConfigurationPrefix);
registerRunConfiguration<QdbRunConfiguration>("QdbLinuxRunConfiguration:");
addSupportedTargetDeviceType(Constants::QdbLinuxOsType);
}

View File

@@ -37,8 +37,6 @@ const char QNX_QNX_QT[] = "Qt4ProjectManager.QtVersion.QNX.QNX";
const char QNX_QNX_FEATURE[] = "QtSupport.Wizards.FeatureQNX";
const char QNX_QNX_RUNCONFIGURATION_PREFIX[] = "Qt4ProjectManager.QNX.QNXRunConfiguration.";
const char QNX_QNX_DEPLOYCONFIGURATION_ID[] = "Qt4ProjectManager.QNX.QNXDeployConfiguration";
const char QNX_QNX_OS_TYPE[] = "QnxOsType"; // Also used for device type.

View File

@@ -102,7 +102,7 @@ Runnable QnxRunConfiguration::runnable() const
QnxRunConfigurationFactory::QnxRunConfigurationFactory()
{
registerRunConfiguration<QnxRunConfiguration>(Constants::QNX_QNX_RUNCONFIGURATION_PREFIX);
registerRunConfiguration<QnxRunConfiguration>("Qt4ProjectManager.QNX.QNXRunConfiguration.");
addSupportedTargetDeviceType(Constants::QNX_QNX_OS_TYPE);
}

View File

@@ -68,11 +68,6 @@ RemoteLinuxCustomRunConfiguration::RemoteLinuxCustomRunConfiguration(Target *tar
setDefaultDisplayName(runConfigDefaultDisplayName());
}
Core::Id RemoteLinuxCustomRunConfiguration::runConfigId()
{
return "RemoteLinux.CustomRunConfig";
}
QString RemoteLinuxCustomRunConfiguration::runConfigDefaultDisplayName()
{
QString remoteExecutable = aspect<ExecutableAspect>()->executable().toString();
@@ -104,8 +99,7 @@ Tasks RemoteLinuxCustomRunConfiguration::checkForIssues() const
RemoteLinuxCustomRunConfigurationFactory::RemoteLinuxCustomRunConfigurationFactory()
: FixedRunConfigurationFactory(RemoteLinuxCustomRunConfiguration::tr("Custom Executable"), true)
{
registerRunConfiguration<RemoteLinuxCustomRunConfiguration>
(RemoteLinuxCustomRunConfiguration::runConfigId());
registerRunConfiguration<RemoteLinuxCustomRunConfiguration>("RemoteLinux.CustomRunConfig");
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
}

View File

@@ -37,7 +37,6 @@ class RemoteLinuxCustomRunConfiguration : public ProjectExplorer::RunConfigurati
public:
RemoteLinuxCustomRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
static Core::Id runConfigId();
QString runConfigDefaultDisplayName();
private:

View File

@@ -93,14 +93,12 @@ Runnable RemoteLinuxRunConfiguration::runnable() const
return r;
}
const char *RemoteLinuxRunConfiguration::IdPrefix = "RemoteLinuxRunConfiguration:";
// RemoteLinuxRunConfigurationFactory
RemoteLinuxRunConfigurationFactory::RemoteLinuxRunConfigurationFactory()
{
registerRunConfiguration<RemoteLinuxRunConfiguration>(RemoteLinuxRunConfiguration::IdPrefix);
registerRunConfiguration<RemoteLinuxRunConfiguration>("RemoteLinuxRunConfiguration:");
setDecorateDisplayNames(true);
addSupportedTargetDeviceType(RemoteLinux::Constants::GenericLinuxOsType);
}

View File

@@ -38,7 +38,6 @@ class RemoteLinuxRunConfiguration final : public ProjectExplorer::RunConfigurati
public:
RemoteLinuxRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
static const char *IdPrefix;
protected:
ProjectExplorer::Runnable runnable() const override;