forked from qt-creator/qt-creator
ProjectExplorer: Introduce an IDevice::usableAsBuildDevice
Better approach than whitelisting ids from leaf plugins. Change-Id: Ida7e23d7ea02eb76d7de4049737f2cb0fad2b9d7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -667,6 +667,11 @@ DeviceEnvironmentFetcher::Ptr DockerDevice::environmentFetcher() const
|
||||
return DeviceEnvironmentFetcher::Ptr();
|
||||
}
|
||||
|
||||
bool DockerDevice::usableAsBuildDevice() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
FilePath DockerDevice::mapToGlobalPath(const FilePath &pathOnDevice) const
|
||||
{
|
||||
if (pathOnDevice.needsDevice()) {
|
||||
|
@@ -76,6 +76,7 @@ public:
|
||||
ProjectExplorer::DeviceTester *createDeviceTester() const override;
|
||||
ProjectExplorer::DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
||||
ProjectExplorer::DeviceEnvironmentFetcher::Ptr environmentFetcher() const override;
|
||||
bool usableAsBuildDevice() const override;
|
||||
|
||||
Utils::FilePath mapToGlobalPath(const Utils::FilePath &pathOnDevice) const override;
|
||||
QString mapToDevicePath(const Utils::FilePath &globalPath) const override;
|
||||
|
@@ -126,6 +126,11 @@ QUrl DesktopDevice::toolControlChannel(const ControlChannelHint &) const
|
||||
return url;
|
||||
}
|
||||
|
||||
bool DesktopDevice::usableAsBuildDevice() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DesktopDevice::handlesFile(const FilePath &filePath) const
|
||||
{
|
||||
return !filePath.needsDevice();
|
||||
|
@@ -30,6 +30,7 @@ public:
|
||||
DeviceProcessSignalOperation::Ptr signalOperation() const override;
|
||||
DeviceEnvironmentFetcher::Ptr environmentFetcher() const override;
|
||||
QUrl toolControlChannel(const ControlChannelHint &) const override;
|
||||
bool usableAsBuildDevice() const override;
|
||||
|
||||
bool handlesFile(const Utils::FilePath &filePath) const override;
|
||||
Utils::Environment systemEnvironment() const override;
|
||||
|
@@ -137,6 +137,8 @@ public:
|
||||
virtual bool isCompatibleWith(const Kit *k) const;
|
||||
virtual QList<Task> validate() const;
|
||||
|
||||
virtual bool usableAsBuildDevice() const { return false; }
|
||||
|
||||
QString displayType() const;
|
||||
Utils::OsType osType() const;
|
||||
|
||||
|
@@ -13,8 +13,6 @@
|
||||
#include "toolchain.h"
|
||||
#include "toolchainmanager.h"
|
||||
|
||||
#include <docker/dockerconstants.h>
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/elidinglabel.h>
|
||||
#include <utils/environment.h>
|
||||
@@ -1183,8 +1181,7 @@ private:
|
||||
const DeviceManager *dm = DeviceManager::instance();
|
||||
for (int i = 0; i < dm->deviceCount(); ++i) {
|
||||
IDevice::ConstPtr device = dm->deviceAt(i);
|
||||
if (!(device->type() == Constants::DESKTOP_DEVICE_TYPE
|
||||
|| device->type() == Docker::Constants::DOCKER_DEVICE_TYPE))
|
||||
if (!device->usableAsBuildDevice())
|
||||
blackList.append(device->id());
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user