On Thursday 21 June 2007 11:45, Johannes Meixner wrote:
Is there an automated check which I could apply to YCP sources which tests if a widget is used which does not work o.k. in all underlying UI systems?
Currently we have no such tool. For those optional widgets, widget documentation clearly says that it's optional (a "special widget"), and that the application has to check for availability with UI::HasSpecialWidget(`FancyWidgetName) before it is used. But I think this is a good suggestion, and it also shouldn't be so hard to implement it. On the tool level, we could write something very simple based on 'grep' (or a little more fancy with Perl) that checks for known names of those optional widgets, and if there is one, if the same source file also contains the appropriate UI::HasSpecialWidget() call with the same widget name. But this can go even further, and I am in the process of refactoring the UI engine anyway. The UI itself can check if the application checked for availability of such an optional widget before it created one, and if the application didn't check, the UI engine could write a warning to the log file. That way, application programmers (at least those who don't ignore all warnings in the logs) would notice even if they use only the UI that has all the optional widgets.
I neither have the time nor the interest to read continuously whatever sources of information which widgets I can use in YCP so that it works o.k. for all underlying UI systems.
Well, if you use a widget, you'll probably look up its documentation anyway
where this is spelled out in great detail - both in the reference
documentation and in the reference examples.
But it sure can't hurt to add more checks.
CU
--
Stefan Hundhammer