From d7869967cedbfadf3c0b27fa56fb8bb44d074e5c Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Thu, 10 Nov 2022 10:56:58 +0100 Subject: [PATCH] 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 --- src/plugins/projectexplorer/devicesupport/devicemanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/projectexplorer/devicesupport/devicemanager.cpp b/src/plugins/projectexplorer/devicesupport/devicemanager.cpp index 2d7d060427b..97eb50b8ffc 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);