[Device Notifier] Avoid accessing attributes of stale UDIs

Authored by bruns on Sep 22 2018, 10:19 AM.

Description

[Device Notifier] Avoid accessing attributes of stale UDIs

Summary:
When a Solid device is removed (e.g. a CD is ejected) the notifier tries
to read the attributes although the Source for the UDI has just vanished.

Fixes several QML error messages, i.e. "TypeError: Cannot read property
'...' of undefined" and "Unable to assign [undefined] to QString".

Apparently these errors also have the effect of items showing outdated
state, i.e. optical media still being shown after ejecting it.

CCBUG: 394348

Test Plan:

  1. insert optical medium
  2. eject

Without the changes, the item was stuck
Now, the item is removed as soon as the medium is ejected

Also, no more errors are logged for the devicenotifier

Reviewers: Frameworks, broulik

Reviewed By: broulik

Subscribers: ngraham, plasma-devel

Tags: Plasma

Differential Revision: https://phabricator.kde.org/D15687

Details

Committed
brunsSep 24 2018, 1:27 PM
Reviewer
broulik
Differential Revision
D15687: [Device Notifier] Avoid accessing attributes of stale UDIs
Parents
R120:7a93d2cda3d5: Merge branch 'Plasma/5.14'
Branches
Unknown
Tags
Unknown