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
v0.6
Michail Vourlakos 8 years ago
parent b510fdcdb5
commit e848e6ed14

@ -520,6 +520,8 @@ DragDrop.DropArea {
} }
Containment.onAppletRemoved: { Containment.onAppletRemoved: {
dock.removeAppletItem(applet)
LayoutManager.removeApplet(applet); LayoutManager.removeApplet(applet);
var flexibleFound = false; var flexibleFound = false;
for (var i = 0; i < mainLayout.children.length; ++i) { for (var i = 0; i < mainLayout.children.length; ++i) {
@ -538,8 +540,6 @@ DragDrop.DropArea {
LayoutManager.save(); LayoutManager.save();
updateIndexes(); updateIndexes();
dock.removeAppletItem(applet)
} }
Plasmoid.onUserConfiguringChanged: { Plasmoid.onUserConfiguringChanged: {
@ -633,6 +633,10 @@ DragDrop.DropArea {
}) })
addContainerInLayout(container, applet, x, y); addContainerInLayout(container, applet, x, y);
if(dock) {
dock.addAppletItem(applet);
}
} }
function addContainerInLayout(container, applet, x, y){ function addContainerInLayout(container, applet, x, y){

Loading…
Cancel
Save