Diffusion Solid 8e9fc89918c4

Force reevaluation of Predicates if interfaces are removed

Authored by bruns on Aug 6 2018, 12:21 AM.

Description

Force reevaluation of Predicates if interfaces are removed

Summary:
If an application wants to show only specicific devices based on predicate
matching, and one of the matching devices loses an interface which is
critical for the Predicate to match, the application has to be notified.

As there is no dedicated signal to notify the application about the
fact a device no longer has e.g. a Solid::StorageAccess iface, signal the
device has been removed, and immediately readd it, as the device may
still be relevant.

Remove the call to updateBackend(udi), as the device backend listens to
the InterfacesRemoved signal itself and updates its property cache.

CCBUG: 394348

Test Plan:

  1. Image file mounting via loop-back
    • udisksctl loop-setup -f ~/fat.img -> Icon appears under "Devices"
    • unmount via context-menu in dolphin -> device icon stays in "Devices"
    • set "Auto-clear" flag on loop (e.g. losetup --detach-all)
    • remount
    • unmount -> device icon vanishes from "Devices"
  2. CD-ROM/DVD
    • icon appear when a non-blank medium is inserted
    • vanishes on medium removal
  3. USB stick
    • for each mountable filesystem, an icon appears under "Removable devices"
    • formatting a partition with a non-mountable filesystem/blank removes the entry
    • formatting with a mountable FS (re)adds the entry

Reviewers: Frameworks, broulik, ngraham, apol

Reviewed By: broulik

Subscribers: apol, anthonyfieroni, kde-frameworks-devel

Tags: Frameworks

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

Details

Committed
brunsAug 14 2018, 1:03 PM
Reviewer
broulik
Differential Revision
D14661: Force reevaluation of Predicates if interfaces are removed
Parents
R245:7e4f518e99ac: GIT_SILENT Upgrade KF5 version to 5.50.0.
Branches
Unknown
Tags
Unknown