[Kde-hardware-devel] First capabilities support

Kevin Ottens ervin at kde.org
Sun Feb 19 21:34:11 CET 2006


Hi list,

It's been around a month with no real news from my side. In the meantime I 
spent this month working on the capabilities support for hardware discovery. 
It now works as I'd like (even if it still needs some polishing). For me it's 
the proof that the solution I wanted to implement is feasible.

Of course, now I'd like some comments on the API. My plan is to incrementally 
add some features around volume management (in order to have the necessary 
stuff to port media:/ on solid). Hence why that's definitely the right time 
to provide feedback regarding the hardware discovery layer.

What is currently here:
 - Ability to query a device to know which capabilities are available
 - Specialized interfaces to manipulate capabilities themselves
 - Already implemented (at least partly capabilities) : Block, Storage, Cdrom, 
Volume, OpticalDisc, Processor
 - Mount, unmount and eject support for the Volume capability using async 
calls (currently using KIO::Job)

API wise querying and using a capability looks like this:

KDEHW::Device d = KDEHW::DeviceManager::self().findDevice(...);

if ( d.is<KDEHW::Ifaces::Volume>() )
{
    KIO::Job *job  = d.as<KDEHW::Ifaces::Volume>()->eject();
    // Connect to the job, etc.
}

Features I plan to add in the next weeks:
 - Add capabilities classes in the KDEHW namespace (currently missing), which 
would remove the need to mess with KDEHW::Ifaces::Capability::qobject() from 
application code in order to connect to signals.
 - Support for eject request from devices (cdrom for example)
 - Ability to use the DeviceManager for complex queries (e.g. "give me the 
list of mounted volumes")

Questions and comments are welcome.

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20060219/ded67760/attachment.pgp 


More information about the Kde-hardware-devel mailing list