forked from qt-creator/qt-creator
ProjectExplorer: Introduce a DeviceEnvironmentFetcher
Also, provide implementations for desktop and remote linux. Change-Id: Ib02202bf1829367334035a361ac73317338cd7a6 Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
#include "publickeydeploymentdialog.h"
|
||||
#include "remotelinux_constants.h"
|
||||
#include "remotelinuxsignaloperation.h"
|
||||
#include "remotelinuxenvironmentreader.h"
|
||||
|
||||
#include <coreplugin/id.h>
|
||||
#include <projectexplorer/devicesupport/sshdeviceprocesslist.h>
|
||||
@@ -254,4 +255,29 @@ DeviceProcessSignalOperation::Ptr LinuxDevice::signalOperation() const
|
||||
return DeviceProcessSignalOperation::Ptr(new RemoteLinuxSignalOperation(sshParameters()));
|
||||
}
|
||||
|
||||
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(Utils::Environment(), false); }
|
||||
|
||||
Internal::RemoteLinuxEnvironmentReader m_reader;
|
||||
};
|
||||
|
||||
DeviceEnvironmentFetcher::Ptr LinuxDevice::environmentFetcher() const
|
||||
{
|
||||
return DeviceEnvironmentFetcher::Ptr(new LinuxDeviceEnvironmentFetcher(sharedFromThis()));
|
||||
}
|
||||
|
||||
} // namespace RemoteLinux
|
||||
|
||||
Reference in New Issue
Block a user