[udisks2] fix media change detection for external optical drives
If an external optical drive is connected after Solid does its initial introspection, the resulting UDI does not get a mediaChanged signal/slot connection, and thus fails to react to the media change. Consequently, disc content is not properly updated after the medium is ejected, causing bug #394348.
This patch assumes that an addition of "org.freedesktop.UDisks2.Block" interface means that a new device has been added; in this case, it performs Device::mightBeOpticalDisc() check to add the slotMediaChanged() connection.
- Start KDE Plasma session. Make sure K3b is installed.
- Connect an external USB optical drive.
- Insert the disc
- Observe Device action notifications for the inserted disc.
- Eject the disc.
- Observe Device action notifications.
Behavior before patch: after disc is ejected, a "Copy with K3b" action remains available for the drive
Behavior after patch: after disc is ejected, no actions remain available for the drive
Reviewers: bruns, broulik, dfaure, Frameworks, ngraham
Reviewed By: ngraham
Subscribers: ngraham, bugseforuns, kde-frameworks-devel
Differential Revision: https://phabricator.kde.org/D20508