[Kde-hardware-devel] Making Solid give a visible name for products

Albert Astals Cid aacid at kde.org
Fri Apr 10 17:00:28 CEST 2009


Hi, i'm attaching a patch that adds the visibleName function for Solid 
devices, that is useful for places like the places viewer in dolphin or the 
device notifier in plasma. Currently when i connect my phone i get "Volume 
(fat32)" which sucks for two reasons:
 * It's not much detailed
 * Can't be translated

With the current patch, the "Can't be translated" part is fixed and now i get 
"7,4 GiB External Media" that is not a great improvement but at least can be 
translated.

The code is using "weird" variable names like drive_is_hotpluggable because it 
tries to be as similar to the original libhal-storage code i've been inspired 
by.

I'm not much happy about having to do things like 
	const OpticalDisc disc(const_cast<HalDevice*>(this));
but didn't find a better way to do it.

Comments?

Albert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: solid_visible_name.patch
Type: text/x-patch
Size: 15438 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kde-hardware-devel/attachments/20090410/18aeaffe/attachment.patch 


More information about the Kde-hardware-devel mailing list