From e848e6ed14a05c3a7f989ef370d8f9c03213cc7a Mon Sep 17 00:00:00 2001 From: Michail Vourlakos Date: Sun, 8 Jan 2017 19:23:05 +0200 Subject: [PATCH] fix a crash with right click --when an applet was first added through drag n' drop if afterwards a right click event occured then a crash happened... This fixes this and also properly removing the AppletQuickItem from dockview. So this fixes two crashes concerning the right click event --- containment/contents/ui/main.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/containment/contents/ui/main.qml b/containment/contents/ui/main.qml index cf170d24e..d001fcd4b 100644 --- a/containment/contents/ui/main.qml +++ b/containment/contents/ui/main.qml @@ -520,6 +520,8 @@ DragDrop.DropArea { } Containment.onAppletRemoved: { + dock.removeAppletItem(applet) + LayoutManager.removeApplet(applet); var flexibleFound = false; for (var i = 0; i < mainLayout.children.length; ++i) { @@ -538,8 +540,6 @@ DragDrop.DropArea { LayoutManager.save(); updateIndexes(); - - dock.removeAppletItem(applet) } Plasmoid.onUserConfiguringChanged: { @@ -633,6 +633,10 @@ DragDrop.DropArea { }) addContainerInLayout(container, applet, x, y); + + if(dock) { + dock.addAppletItem(applet); + } } function addContainerInLayout(container, applet, x, y){