ProjectExplorer: Funnel environment fetching through device access

Easier nowadays. It's synchronous now, so conceptually worse,
but 'env' is not worse than 'ls', and this is used regularly
all over the place also for larger data sets without being a problem.

Change-Id: I2c2b1db8c07ff5c128700d4a1deefd710967568a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
hjk
2022-12-15 13:07:10 +01:00
parent 0b6b31b4ba
commit ca6b14cf01
14 changed files with 41 additions and 285 deletions

View File

@@ -9,7 +9,6 @@
#include "linuxprocessinterface.h"
#include "publickeydeploymentdialog.h"
#include "remotelinux_constants.h"
#include "remotelinuxenvironmentreader.h"
#include "remotelinuxsignaloperation.h"
#include "remotelinuxtr.h"
#include "sshprocessinterface.h"
@@ -1043,31 +1042,6 @@ DeviceProcessSignalOperation::Ptr LinuxDevice::signalOperation() const
return DeviceProcessSignalOperation::Ptr(new RemoteLinuxSignalOperation(sharedFromThis()));
}
class LinuxDeviceEnvironmentFetcher : public DeviceEnvironmentFetcher
{
public:
LinuxDeviceEnvironmentFetcher(const IDevice::ConstPtr &device)
: m_reader(device)
{
connect(&m_reader, &Internal::RemoteLinuxEnvironmentReader::finished,
this, &LinuxDeviceEnvironmentFetcher::readerFinished);
connect(&m_reader, &Internal::RemoteLinuxEnvironmentReader::error,
this, &LinuxDeviceEnvironmentFetcher::readerError);
}
private:
void start() override { m_reader.start(); }
void readerFinished() { emit finished(m_reader.remoteEnvironment(), true); }
void readerError() { emit finished(Environment(), false); }
Internal::RemoteLinuxEnvironmentReader m_reader;
};
DeviceEnvironmentFetcher::Ptr LinuxDevice::environmentFetcher() const
{
return DeviceEnvironmentFetcher::Ptr(new LinuxDeviceEnvironmentFetcher(sharedFromThis()));
}
bool LinuxDevice::usableAsBuildDevice() const
{
return true;
@@ -1097,11 +1071,6 @@ ProcessInterface *LinuxDevice::createProcessInterface() const
return new LinuxProcessInterface(this);
}
Environment LinuxDevice::systemEnvironment() const
{
return {}; // FIXME. See e.g. Docker implementation.
}
LinuxDevicePrivate::LinuxDevicePrivate(LinuxDevice *parent)
: q(parent)
{