fix crash,when alternatives shown + change layouts

pull/1/head
Michail Vourlakos 8 years ago
parent 14d7ae5d55
commit 9a72f394ee

@ -1001,7 +1001,17 @@ void DockCorona::showAlternativesForApplet(Plasma::Applet *applet)
return;
}
KDeclarative::QmlObject *qmlObj = new KDeclarative::QmlObject(this);
DockView *dockView = m_dockViews[applet->containment()];
KDeclarative::QmlObject *qmlObj{nullptr};
if (dockView) {
dockView->setAlternativesIsShown(true);
qmlObj = new KDeclarative::QmlObject(dockView);
} else {
qmlObj = new KDeclarative::QmlObject(this);
}
qmlObj->setInitializationDelayed(true);
qmlObj->setSource(QUrl::fromLocalFile(alternativesQML));
@ -1011,12 +1021,7 @@ void DockCorona::showAlternativesForApplet(Plasma::Applet *applet)
m_alternativesObjects << qmlObj;
qmlObj->completeInitialization();
DockView *dockView = m_dockViews[applet->containment()];
if (dockView) {
dockView->setAlternativesIsShown(true);
}
//! Alternative dialog signals
connect(helper, &QObject::destroyed, this, [dockView]() {
dockView->setAlternativesIsShown(false);
});

@ -1165,9 +1165,13 @@ void DockView::setBlockHiding(bool block)
return;
}
m_visibility->setBlockHiding(false);
if (m_visibility) {
m_visibility->setBlockHiding(false);
}
} else {
m_visibility->setBlockHiding(true);
if (m_visibility) {
m_visibility->setBlockHiding(true);
}
}
}

Loading…
Cancel
Save