> On March 11, 2013, 3:19 p.m., Dan Vrátil wrote:
> > The patch looks fine in general.
> > 
> > Could you however look whether following solution would work? I think that 
> > cleaner approach would be if the backend would emit changed() when a new 
> > interface is added or removed. This way, if signals are first deliver to 
> > Manager (which therefore passes "outdated" Device to user) would not be a 
> > problem. Later, when the signals are delivered to the DeviceBackend, it 
> > would emit changed() and UI would be updated with the new values.
> >

It won't work. If signals are delivered to Manager first, then deviceAdded will 
be emitted even before InterfaceAdded will be delivered to Backend. And 
receivers of deviceAdded will read old property values before Backend emits 
changed(). Or maybe I didn't understand you.

Clean approach is reworking Manager/Backend in a way that only Manager or only 
Backend receives signals from D-Bus and propagates them to other. I consider 
this patch only as temporary workaround.


- Alexander


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/109418/#review28980
-----------------------------------------------------------


On March 11, 2013, 1:51 p.m., Alexander Mezin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/109418/
> -----------------------------------------------------------
> 
> (Updated March 11, 2013, 1:51 p.m.)
> 
> 
> Review request for Solid and Lukáš Tinkl.
> 
> 
> Description
> -------
> 
> DeviceManager and DeviceBackends are subscribed to the same signals. 
> DeviceManager's slots can be executed earlier than DeviceBackend's, so when 
> deviceAdded signals are emitted by DeviceManager, DeviceBackend could contain 
> non-updated data.
> Usually the problem appears with optical disks: device notifier shows 
> inserted disks as generic storage volumes or shows wrong label.
> 
> Possible workaround is forcing refresh of DeviceBackend's property cache 
> before emitting deviceAdded signal. For optical disks drive's properties 
> should also be updated, because OpticalDisc reads drive's properties
> 
> 
> This addresses bug 314778.
>     http://bugs.kde.org/show_bug.cgi?id=314778
> 
> 
> Diffs
> -----
> 
>   solid/solid/backends/udisks2/udisksdevicebackend.h 
> 829fa41e8700e68abbb27c4a326f35eaffc39898 
>   solid/solid/backends/udisks2/udisksdevicebackend.cpp 
> 2a01b86690077df3738f740c50b29c46b40d4287 
>   solid/solid/backends/udisks2/udisksmanager.h 
> fb929ce13d69aea462cc6b96149f284b991fe39c 
>   solid/solid/backends/udisks2/udisksmanager.cpp 
> 71b9e3edebcf818f32567fb15bc391dccfbf7981 
> 
> Diff: http://git.reviewboard.kde.org/r/109418/diff/
> 
> 
> Testing
> -------
> 
> Tested on KDE 4.10.1
> 
> 
> Thanks,
> 
> Alexander Mezin
> 
>

_______________________________________________
Kde-hardware-devel mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-hardware-devel

Reply via email to