[AppletQuickItem] Preload applet expander only if not already expanded

When an applet is placed on the desktop and already shows its full representation, like Weather applet,
don't create the expander item.
The DefaultCompactApplet shows the dialog when plasmoid.expanded which will be always the case and you end up with an empty
window randomly showing up on startup.

Differential Revision: https://phabricator.kde.org/D10764
This commit is contained in:
Kai Uwe Broulik 2018-02-23 12:59:41 +01:00
parent 79fb4ebfa7
commit 48b62d1a27

View File

@ -296,7 +296,9 @@ void AppletQuickItemPrivate::preloadForExpansion()
time = QDateTime::currentMSecsSinceEpoch();
}
createFullRepresentationItem();
if (!applet->isContainment() &&
// When not already expanded, also preload the expander
if (!expanded && !applet->isContainment() &&
(!preferredRepresentation ||
preferredRepresentation != fullRepresentation)) {
createCompactRepresentationExpanderItem();