forked from qt-creator/qt-creator
Qdb: use new runconfiguration aspect update mechanism
Change-Id: Ib8822ac62d364bbbe8b9fd61b238c841dc39a777 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -86,10 +86,17 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Core::Id id)
|
|||||||
addAspect<WorkingDirectoryAspect>();
|
addAspect<WorkingDirectoryAspect>();
|
||||||
addAspect<FullCommandLineAspect>(this);
|
addAspect<FullCommandLineAspect>(this);
|
||||||
|
|
||||||
connect(target, &Target::kitChanged,
|
setUpdater([this, target, exeAspect, symbolsAspect] {
|
||||||
this, &QdbRunConfiguration::updateTargetInformation);
|
const BuildTargetInfo bti = buildTargetInfo();
|
||||||
connect(target, &Target::buildSystemUpdated,
|
const FilePath localExecutable = bti.targetFilePath;
|
||||||
this, &QdbRunConfiguration::updateTargetInformation);
|
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"));
|
setDefaultDisplayName(tr("Run on Boot2Qt Device"));
|
||||||
}
|
}
|
||||||
@@ -107,16 +114,6 @@ ProjectExplorer::RunConfiguration::ConfigurationState QdbRunConfiguration::ensur
|
|||||||
return Configured;
|
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
|
QString QdbRunConfiguration::defaultDisplayName() const
|
||||||
{
|
{
|
||||||
return RunConfigurationFactory::decoratedTargetName(buildKey(), target());
|
return RunConfigurationFactory::decoratedTargetName(buildKey(), target());
|
||||||
|
@@ -48,7 +48,6 @@ public:
|
|||||||
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
ConfigurationState ensureConfigured(QString *errorMessage) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateTargetInformation();
|
|
||||||
QString defaultDisplayName() const;
|
QString defaultDisplayName() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user