From: Bohdan Onofriichuk Date: Mon, 5 May 2025 19:13:54 +0000 (+0000) Subject: [PATCH] applets/devicenotifier: check if device has been added before X-Git-Tag: archive/raspbian/4%6.3.6-2+rpi1^2~21 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=86190a7886a6c9047a55fe0f146bceb7272faffc;p=plasma-workspace.git [PATCH] applets/devicenotifier: check if device has been added before BUG: 495140 Skip device if applet already has device with similar udi Gbp-Pq: Name upstream_a83c4e5f_applets-devicenotifier-check-if-device-has-been-added-before.patch --- diff --git a/applets/devicenotifier/plugin/devicecontrol.cpp b/applets/devicenotifier/plugin/devicecontrol.cpp index 829027ce..1e8c7403 100644 --- a/applets/devicenotifier/plugin/devicecontrol.cpp +++ b/applets/devicenotifier/plugin/devicecontrol.cpp @@ -152,6 +152,12 @@ QHash DeviceControl::roleNames() const void DeviceControl::onDeviceAdded(const QString &udi) { qCDebug(APPLETS::DEVICENOTIFIER) << "Device Controller: Added device signal arrived : " << udi; + + if (m_actions.contains(udi)) { + qCDebug(APPLETS::DEVICENOTIFIER) << "Device Controller: Device already exists. Don't add another one : " << udi; + return; + } + Solid::Device device(udi); if (!device.isValid()) {