aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
diff options
context:
space:
mode:
authorMarcus Tillmanns <marcus.tillmanns@qt.io>2022-11-10 10:56:58 +0100
committerMarcus Tillmanns <marcus.tillmanns@qt.io>2022-11-17 14:10:11 +0000
commitd7869967cedbfadf3c0b27fa56fb8bb44d074e5c (patch)
tree8a3e43d4062db478a39ffa5802f817e6d5ddde24 /src/plugins/projectexplorer/devicesupport/devicemanager.cpp
parent1ba366c5c0d6da797faed3cb4a2dedd7821cb872 (diff)
ProjectExplorer: Remove duplicate devices
In rare cases it can happen that the installer creates a device that happens to have the same rootPath as a user created device. We need to filter these out since otherwise it can be random which of the two devices is selected. Change-Id: I8269795a2e4f439fb2f02d819272723a504c6703 Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/projectexplorer/devicesupport/devicemanager.cpp')
-rw-r--r--src/plugins/projectexplorer/devicesupport/devicemanager.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
index 2d7d060427..97eb50b8ff 100644
--- a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
+++ b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp
@@ -174,7 +174,7 @@ void DeviceManager::load()
// devices with the same id.
for (IDevice::ConstPtr device : std::as_const(userDevices)) {
for (const IDevice::Ptr &sdkDevice : std::as_const(sdkDevices)) {
- if (device->id() == sdkDevice->id()) {
+ if (device->id() == sdkDevice->id() || device->rootPath() == sdkDevice->rootPath()) {
if (device->version() < sdkDevice->version())
device = sdkDevice;
sdkDevices.removeOne(sdkDevice);