Qdb: use new runconfiguration aspect update mechanism

Change-Id: Ib8822ac62d364bbbe8b9fd61b238c841dc39a777
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-11-25 18:40:12 +01:00
parent 6b4a0ed47d
commit 300a022bcd
2 changed files with 11 additions and 15 deletions

View File

@@ -86,10 +86,17 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Core::Id id)
addAspect<WorkingDirectoryAspect>();
addAspect<FullCommandLineAspect>(this);
connect(target, &Target::kitChanged,
this, &QdbRunConfiguration::updateTargetInformation);
connect(target, &Target::buildSystemUpdated,
this, &QdbRunConfiguration::updateTargetInformation);
setUpdater([this, target, exeAspect, symbolsAspect] {
const BuildTargetInfo bti = buildTargetInfo();
const FilePath localExecutable = bti.targetFilePath;
const DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable);
exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath()));
symbolsAspect->setFilePath(localExecutable);
});
connect(target, &Target::kitChanged, this, &RunConfiguration::update);
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
setDefaultDisplayName(tr("Run on Boot2Qt Device"));
}
@@ -107,16 +114,6 @@ ProjectExplorer::RunConfiguration::ConfigurationState QdbRunConfiguration::ensur
return Configured;
}
void QdbRunConfiguration::updateTargetInformation()
{
const BuildTargetInfo bti = buildTargetInfo();
const FilePath localExecutable = bti.targetFilePath;
const DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable);
aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(depFile.remoteFilePath()));
aspect<SymbolFileAspect>()->setFilePath(localExecutable);
}
QString QdbRunConfiguration::defaultDisplayName() const
{
return RunConfigurationFactory::decoratedTargetName(buildKey(), target());

View File

@@ -48,7 +48,6 @@ public:
ConfigurationState ensureConfigured(QString *errorMessage) override;
private:
void updateTargetInformation();
QString defaultDisplayName() const;
};