Hide disabled contextual actions from ExpandableListItem
requested to merge ngraham/plasma-framework:hide-disabled-actions-from-expandablelistitem into master
The concept of a disabled contextual item is nonsensical; the set of context-sensitive actions is always supposed to be responsive to the context. Accordingly, if the calling code has marked any actions as disabled, let's hide them entirely.
We can't remove them from the model because they might become re-enabled at a time when the calling app sees fit (perhaps the context has changed). So instead we have to set visible to false and height to 0, to ensure that the listview has the correct height. This is a hack, but I don't see a better way to do it.
The memory penalty to having invisible but created items should be negligible since there are only ever a maximum of about 3 items in here.