On Saturday 29 August 2009 01:40:12 Ben Cooksley wrote: > Probably the best way to do it. > Extracting it from the predicate would be possible, except predicates > are a total pain to parse, and doing it manually with QString is > probably very slow.
Well, we don't provide access to the internal parser results for obvious reasons. Still, you have Solid::Predicate::usedTypes() which might be interesting in your case. ;-) > I was never able to figure out how Solid itself parsed them. There's a Flex/Bison parser for the predicate language in libsolid. > It appears that some of the new generation of predicates are not > supported by the Device Actions KCM either which I'd like to fix. > > Perhaps a X-KDE-Solid-Devices property which specifies what types of > devices it affects? See above, the Solid::Predicate class provides just that out of the box. > Its predicate is "[ Camera.supportedDrivers == 'gphoto' ]" > It likely does come with KDEGraphics, as that is one of the modules I > install from trunk. Yeah should drop the [ ], also supportedDrivers provides a QStringList, I'm not quite sure how we do the matching for those... It's left to QVariant which in this case should work I guess. Definitely needs to be investigated further. If you feel like taking a look at it that would be just nice. Obviously a good way for you to know how we process predicates in libsolid which is directly useful knowledge for your work on the KCM. Feel free to ask questions here or on IRC I'll try to help if I can. 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."
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Kde-hardware-devel mailing list [email protected] https://mail.kde.org/mailman/listinfo/kde-hardware-devel
