[Kde-hardware-devel] Some cache in Solid? Solid::Device::listFromQuery gives outdated data

Albert Astals Cid aacid at kde.org
Thu Sep 24 00:45:51 CEST 2009


A Dimecres, 23 de setembre de 2009, Rafał Miłecki va escriure:
> Hi again,
> 
> I can not understand why kio_sysinfo gets outdated data from
> Solid::Device::listFromQuery.
> 
> How to reproduce:
> 1) Plug in some pendrive
> 2) Run "konqeuror sysinfo:/"
> 3) Mount pendrive using for ex. DeviceNotifier
> 4) Refresh sysinfo:/ page in Konqueror
> 
> The problem is that
> bool kio_sysinfoProtocol::fillMediaDevices()
> still gets info that pendrive is not mounted.
> 
> The same problem happens in second order:
> 1) Plug in pendrive
> 2) Mount it using for ex. DeviceNotifier
> 3) Run "konqeuror sysinfo:/"
> 4) Unmount pendirve using for ex. DeviceNotifier
> 5) Refresh sysinfo:/ page in Konqueror
> 
> Again bool kio_sysinfoProtocol::fillMediaDevices() gets info that
> pendrive is mounted and it even gets it's old mount point.
> 
> Could someone explain this to me, please?
> 
> Source:
> http://websvn.kde.org/trunk/playground/base/kio_sysinfo/src/
> 
> You may want to put:
> kDebug() << "[DBG]" << di.deviceNode << ": isAccesible:" <<
> access->isAccessible() << " ; filePath:" << access->filePath();
> in bool kio_sysinfoProtocol::fillMediaDevices()
> 

Yes, the solid hal backend has a cache of hal returned information via dbus, 
this cache is invalidated when hal sends a specific signal via dbus, the 
problem is that qdbus does not work in kio slaves because it needs an event 
loop and kio slaves don't have one.

Talking with dfaure it seems there are three solutions:
 * Add a thread with an event loop to the sysinfo slave and do the solid calls 
there and somehow pass the info 
 * Tell solid not to cache the information

I've tried to prepare a cude hack based on the first and seems to work for me, 
can you try the following patch?

Albert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solid.patch
Type: text/x-patch
Size: 5738 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20090924/8f4500d2/attachment.patch 


More information about the Kde-hardware-devel mailing list