Qnx: Add QnxRunConfiguration::doAdditionalSetup()

Same principle as in b526d789cf.

Change-Id: I79b69f709ab401b46d2edef3b5a6b0672e30eaff
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2019-12-12 14:40:46 +01:00
parent 864e79980b
commit f29a4440fe
2 changed files with 27 additions and 16 deletions

View File

@@ -68,22 +68,14 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Core::Id id)
libAspect->setLabelText(tr("Path to Qt libraries on device")); libAspect->setLabelText(tr("Path to Qt libraries on device"));
libAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); libAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);
auto updateTargetInformation = [this, target, exeAspect, symbolsAspect] { connect(target, &Target::deploymentDataChanged,
this, &QnxRunConfiguration::updateTargetInformation);
const BuildTargetInfo bti = buildTargetInfo(); connect(target, &Target::applicationTargetsChanged,
const FilePath localExecutable = bti.targetFilePath; this, &QnxRunConfiguration::updateTargetInformation);
const DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable); connect(target->project(), &Project::parsingFinished,
this, &QnxRunConfiguration::updateTargetInformation);
exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath())); connect(target, &Target::kitChanged,
symbolsAspect->setFilePath(localExecutable); this, &QnxRunConfiguration::updateTargetInformation);
emit enabledChanged();
};
connect(target, &Target::deploymentDataChanged, this, updateTargetInformation);
connect(target, &Target::applicationTargetsChanged, this, updateTargetInformation);
connect(target->project(), &Project::parsingFinished, this, updateTargetInformation);
connect(target, &Target::kitChanged, this, updateTargetInformation);
} }
Runnable QnxRunConfiguration::runnable() const Runnable QnxRunConfiguration::runnable() const
@@ -100,6 +92,22 @@ Runnable QnxRunConfiguration::runnable() const
return r; return r;
} }
void QnxRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &)
{
updateTargetInformation();
}
void QnxRunConfiguration::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);
emit enabledChanged();
}
// QnxRunConfigurationFactory // QnxRunConfigurationFactory
QnxRunConfigurationFactory::QnxRunConfigurationFactory() QnxRunConfigurationFactory::QnxRunConfigurationFactory()

View File

@@ -48,6 +48,9 @@ public:
private: private:
ProjectExplorer::Runnable runnable() const override; ProjectExplorer::Runnable runnable() const override;
void doAdditionalSetup(const ProjectExplorer::RunConfigurationCreationInfo &) override;
void updateTargetInformation();
}; };
class QnxRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory class QnxRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory