diff --git a/applet/contents/ui/PopupDialog.qml b/applet/contents/ui/PopupDialog.qml --- a/applet/contents/ui/PopupDialog.qml +++ b/applet/contents/ui/PopupDialog.qml @@ -26,20 +26,24 @@ import org.kde.plasma.networkmanagement 0.2 as PlasmaNM FocusScope { + id: full property var notificationInhibitorLock: undefined PlasmaNM.AvailableDevices { id: availableDevices } - PlasmaNM.NetworkModel { - id: connectionModel + Component { + id: networkModelComponent + PlasmaNM.NetworkModel {} } + property PlasmaNM.NetworkModel connectionModel: null + PlasmaNM.AppletProxyModel { id: appletProxyModel - sourceModel: connectionModel + sourceModel: full.connectionModel } ColumnLayout { @@ -93,6 +97,12 @@ notificationInhibitorLock = undefined; toolbar.closeSearch() } + + if (expanded) { + full.connectionModel = networkModelComponent.createObject(full) + } else { + full.connectionModel.destroy() + } } }