
The point of a hash table is that you don't need to list all the elements. To avoid that, keep a "clearableCount" in MessageTray, which can be used by the message tray menu to show and hide the clear item, and that is updated in constant time when sources are added or removed. https://bugzilla.gnome.org/show_bug.cgi?id=700194