forked from qt-creator/qt-creator
CMake: Do not store the "title" in the run configuration
This has been superseded by other items, most notably the buildKey. Incidentally, even Creator 4.6 is robust enough to handle .user files without the CMakeProjectManager.CMakeRunConfiguation.Title key without problem. Change-Id: Iaecb2c15b31ebfb78146c0bec8b955ae821e4499 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
@@ -40,8 +40,6 @@ using namespace ProjectExplorer;
|
|||||||
namespace CMakeProjectManager {
|
namespace CMakeProjectManager {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
const char TITLE_KEY[] = "CMakeProjectManager.CMakeRunConfiguation.Title";
|
|
||||||
|
|
||||||
CMakeRunConfiguration::CMakeRunConfiguration(Target *target, Core::Id id)
|
CMakeRunConfiguration::CMakeRunConfiguration(Target *target, Core::Id id)
|
||||||
: RunConfiguration(target, id)
|
: RunConfiguration(target, id)
|
||||||
{
|
{
|
||||||
@@ -68,23 +66,9 @@ CMakeRunConfiguration::CMakeRunConfiguration(Target *target, Core::Id id)
|
|||||||
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
setOutputFormatter<QtSupport::QtOutputFormatter>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantMap CMakeRunConfiguration::toMap() const
|
|
||||||
{
|
|
||||||
QVariantMap map(RunConfiguration::toMap());
|
|
||||||
map.insert(QLatin1String(TITLE_KEY), m_title);
|
|
||||||
return map;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CMakeRunConfiguration::fromMap(const QVariantMap &map)
|
|
||||||
{
|
|
||||||
RunConfiguration::fromMap(map);
|
|
||||||
m_title = map.value(QLatin1String(TITLE_KEY)).toString();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CMakeRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &info)
|
void CMakeRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &info)
|
||||||
{
|
{
|
||||||
m_title = info.displayName;
|
Q_UNUSED(info);
|
||||||
updateTargetInformation();
|
updateTargetInformation();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -112,8 +96,6 @@ QString CMakeRunConfiguration::disabledReason() const
|
|||||||
|
|
||||||
void CMakeRunConfiguration::updateTargetInformation()
|
void CMakeRunConfiguration::updateTargetInformation()
|
||||||
{
|
{
|
||||||
setDefaultDisplayName(m_title);
|
|
||||||
|
|
||||||
BuildTargetInfo bti = target()->applicationTargets().buildTargetInfo(buildKey());
|
BuildTargetInfo bti = target()->applicationTargets().buildTargetInfo(buildKey());
|
||||||
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
extraAspect<ExecutableAspect>()->setExecutable(bti.targetFilePath);
|
||||||
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory);
|
extraAspect<WorkingDirectoryAspect>()->setDefaultWorkingDirectory(bti.workingDirectory);
|
||||||
|
@@ -38,17 +38,13 @@ public:
|
|||||||
CMakeRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
CMakeRunConfiguration(ProjectExplorer::Target *target, Core::Id id);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QVariantMap toMap() const override;
|
|
||||||
QString disabledReason() const override;
|
QString disabledReason() const override;
|
||||||
|
|
||||||
bool fromMap(const QVariantMap &map) override;
|
|
||||||
void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &) override;
|
void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &) override;
|
||||||
bool isBuildTargetValid() const;
|
bool isBuildTargetValid() const;
|
||||||
void updateTargetInformation();
|
void updateTargetInformation();
|
||||||
|
|
||||||
void updateEnabledState() final;
|
void updateEnabledState() final;
|
||||||
|
|
||||||
QString m_title;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
class CMakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
class CMakeRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||||
|
Reference in New Issue
Block a user