Skip to content
Commit 8e9fc899 authored by Stefan Brüns's avatar Stefan Brüns
Browse files

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
parent 7e4f518e
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment