[Kde-hardware-devel] [PATCH] Optimise HAL backend

Kevin Ottens ervin at kde.org
Tue Mar 14 18:02:24 CET 2006


Le Mardi 14 Mars 2006 17:09, Michaël Larouche a écrit :
> The goal of this patch is to do less D-BUS calls as possible.

A few comments on the patch:
1) I would revert the if () for readability. If it's in the cache return it 
else ask hal.
2) For propertyExists() I would keep an entry holding QVariant() if HAL 
returned false. Otherwise you'll query HAL each time except if the property 
exists.
3) Calling allProperties() in the constructor is a bad idea IMHO. You'll keep 
in memory a lot of useless information. Moreover as soon as you'll get a 
PropertyModified() signal, the map you return from allProperties() is wrong. 
This part should definitely be rethought.

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: 191 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20060314/fceea322/attachment.pgp 


More information about the Kde-hardware-devel mailing list