[udisks2] fix media change detection for external optical drives
ClosedPublic

Authored by rokmandeljc on Apr 13 2019, 2:47 PM.

Details

Summary

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.

BUG: 394348
FIXED-IN: 5.65

Test Plan

Test steps:

  1. Start KDE Plasma session. Make sure K3b is installed.
  2. Connect an external USB optical drive.
  3. Insert the disc
  4. Observe Device action notifications for the inserted disc.
  5. Eject the disc.
  6. Observe Device action notifications.

Behavior before patch: after disc is ejected, a "Copy with K3b" action remains available for the drive
See: https://bugs.kde.org/show_bug.cgi?id=394348

Behavior after patch: after disc is ejected, no actions remain available for the drive

Diff Detail

Repository
R245 Solid
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rokmandeljc created this revision.Apr 13 2019, 2:47 PM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald TranscriptApr 13 2019, 2:47 PM
rokmandeljc requested review of this revision.Apr 13 2019, 2:47 PM
ngraham retitled this revision from frameworks-solid: udisks2: fix media change detection for external optical drives to [udisks2] fix media change detection for external optical drives.Apr 13 2019, 3:32 PM
ngraham edited the summary of this revision. (Show Details)
ngraham added reviewers: bruns, broulik, dfaure, Frameworks.

I'm not a software developer, but I applied Rok's patch on Arch Linux and it fixes the problem when unmounting/releasing ISO images.

Operating System: Arch Linux
KDE Plasma Version: 5.15.4
KDE Frameworks Version: 5.57.0
Qt Version: 5.12.2

ngraham accepted this revision.Nov 10 2019, 3:17 PM
ngraham added a subscriber: ngraham.

I'm very sorry that this patch appears to have been lost along the way. I've tested it and it works for me. @bruns, are you okay with this?

This revision is now accepted and ready to land.Nov 10 2019, 3:17 PM
ngraham edited the summary of this revision. (Show Details)Nov 12 2019, 5:33 PM
This revision was automatically updated to reflect the committed changes.