# HG changeset patch # User Goffi # Date 1579283075 -3600 # Node ID e9d3c3793f943db4a10b28d96e6434d627181b9b # Parent 1ac40d3121f63f2d31fbb34038062f840efef14d core (Cagou): "None" can be used in getVisibleList's cls to get all visible widgets diff -r 1ac40d3121f6 -r e9d3c3793f94 cagou/core/cagou_main.py --- a/cagou/core/cagou_main.py Fri Jan 17 18:44:35 2020 +0100 +++ b/cagou/core/cagou_main.py Fri Jan 17 18:44:35 2020 +0100 @@ -787,12 +787,19 @@ """get list of visible widgets for a given class @param cls(type): type of widgets to get - @return (list[type]): visible widgets of this class + None to get all visible widgets + @return (set[type]): visible widgets of this class """ + if cls is None: + ret = set() + for widgets in self._visible_widgets.values(): + for w in widgets: + ret.add(w) + return ret try: return self._visible_widgets[cls] except KeyError: - return [] + return set() def deleteUnusedWidgetInstances(self, widget): """Delete instance of this widget without parent