Created attachment 125260 [details] example app listen to deviceAdded and deviceRemoved, run Solid::Device::allDevices().count() each time STEPS TO REPRODUCE 1. see example code 2. run 3. attach thumb drive 4. remove 5. add 6. remove OBSERVED RESULT see overall device count of Device::allDevices go up and up and up. it looks to me that all disk devices simply get duplicated each time. this ultimately results in at least part of the defect described in bug #399746 where kinfocenter will display garbage entries. this is because kinfocenter listens to the notifications but then always runs through the entire allDevices list to inject new devices into the treeview, as such each time devices get duplicated the list in kinfocenter grows. EXPECTED RESULT device count doesn't keep growing SOFTWARE/OS VERSIONS KDE Plasma Version: 5.17.5 KDE Frameworks Version: 5.66.0 Qt Version: 5.13.2 Kernel Version: 5.5.0-050500rc5-generic OS Type: 64-bit Processors: 12 × AMD Ryzen 5 3600X 6-Core Processor Memory: 15,6 GiB of RAM
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/solid/-/merge_requests/11
Fixed by https://invent.kde.org/frameworks/solid/-/commit/0ac1bf37c0645d66efacbd1c17af5ed59c2e59db