RemoteLinux: Use new runconfiguration aspect update mechanism

Change-Id: I8f518f323e8d2437809bdffc21492e4238df10d5
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2019-11-25 14:51:52 +01:00
parent cc60efdbf6
commit 9e2484052d
2 changed files with 13 additions and 19 deletions

View File

@@ -69,10 +69,19 @@ RemoteLinuxRunConfiguration::RemoteLinuxRunConfiguration(Target *target, Core::I
if (HostOsInfo::isAnyUnixHost())
addAspect<X11ForwardingAspect>();
connect(target, &Target::buildSystemUpdated,
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
connect(target, &Target::kitChanged,
this, &RemoteLinuxRunConfiguration::updateTargetInformation);
setUpdater([this, target, exeAspect, symbolsAspect] {
BuildTargetInfo bti = buildTargetInfo();
const FilePath localExecutable = bti.targetFilePath;
DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable);
exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath()));
symbolsAspect->setFilePath(localExecutable);
emit enabledChanged();
});
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
connect(target, &Target::kitChanged, this, &RunConfiguration::update);
}
Runnable RemoteLinuxRunConfiguration::runnable() const
@@ -84,18 +93,6 @@ Runnable RemoteLinuxRunConfiguration::runnable() const
return r;
}
void RemoteLinuxRunConfiguration::updateTargetInformation()
{
BuildTargetInfo bti = buildTargetInfo();
const FilePath localExecutable = bti.targetFilePath;
DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable);
aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(depFile.remoteFilePath()));
aspect<SymbolFileAspect>()->setFilePath(localExecutable);
emit enabledChanged();
}
const char *RemoteLinuxRunConfiguration::IdPrefix = "RemoteLinuxRunConfiguration:";

View File

@@ -42,9 +42,6 @@ public:
protected:
ProjectExplorer::Runnable runnable() const override;
private:
void updateTargetInformation();
};
class RemoteLinuxRunConfigurationFactory final : public ProjectExplorer::RunConfigurationFactory