Update applet alternatives menu entry visibility on demand
Review Request #129086 - Created Oct. 3, 2016 and submitted
It's reasnoble to expect people to download an applet just before trying
to change an existing applet using the alternatives system.
Therefore doing the check that any alternative applets exist during applet initialisation time is semantically
wrong as the option will be prematurely disabled.
This patch moves it to be verified in contextualActionsAboutToShow.
This patch also gives a startup performance boost.
Loading all the applets metadata takes a small amount of time (~50 milliseconds) not really noticable when you're doing it once, but it adds up when we're doing it for a lot of applets in a row.
Right click on kickoff, option was there and worked
Right click on system tray, no option
Locked widges, option wasn't there
Unlocked widgets, option in kickoff came back
Context menu still appears "instantly"
This made the Alternatives action visible in toolbox menu.
The problem is that toolbox tries to emit
AppletInterface, but the connection between
AppletInterface::contextualActionsAboutToShowis only one way (signal from
Appletgets propageted to
AppletInterface, not the other way).
This never worked (emitting
contextualActionsAboutToShowfrom plasmoid), but only this change exposed it.
I have no idea how to fix it, other than adding new method to
AppletInterfaceto emit this signal or hacky both-way connection.