D19677: Port UDisks to using DBus ObjectManager
Kai Uwe Broulik
noreply at phabricator.kde.org
Mon Mar 11 11:18:27 GMT 2019
broulik created this revision.
broulik added reviewers: Frameworks, bruns.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
broulik requested review of this revision.
REVISION SUMMARY
Right now it introspects DBus and fetches properties all over the place.
This patch changes UDisks Manager to be the governor of all device data,
calling GetManagedObjects (which conveniently returns all the properties)
on startup. It also connects to change signals and updates the cache
accordingly and tells the devices about it.
This reduces impact of UDisks backend on Dolphin startup from 4.3% to 0.3%
on my machine. On my laptop it spent 130ms on startup trying to figure out
if something might be a optical drive or not...
Since I don't have an optical drive, it is likely that handling for these
is broken in this patch, at least one FIXME is definitely breaking it :)
While it sheds quite some code and compacts property caching in a single place
I'm not too happy about having this static Manager pointer in DeviceBackend,
with both Manager telling the Device about changed properties and the Device
asking the Manager about its properties.. Also, the Block directly accessing
the Manager is somehwat awful.
Fix updating existing device when it gains new interfaces
So many hours wasted finding this...
Fix monitoring optical drives
We already listen to all change events anyway so rather than explicitly connecting
to a certain path like the old one, we just process everything and try to figure out
if it was meant for an optical drive whose disc became available.
For the lack of an optical drive, I tested it in VirtualBox where attaching and
removing CD images worked fine now.
REPOSITORY
R245 Solid
BRANCH
broulik/objectmanager
REVISION DETAIL
https://phabricator.kde.org/D19677
AFFECTED FILES
src/solid/devices/backends/udisks2/udisks2.h
src/solid/devices/backends/udisks2/udisksblock.cpp
src/solid/devices/backends/udisks2/udisksdevice.cpp
src/solid/devices/backends/udisks2/udisksdevicebackend.cpp
src/solid/devices/backends/udisks2/udisksdevicebackend.h
src/solid/devices/backends/udisks2/udisksmanager.cpp
src/solid/devices/backends/udisks2/udisksmanager.h
To: broulik, #frameworks, bruns
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20190311/2cf8f047/attachment.html>
More information about the Kde-frameworks-devel
mailing list