plasma: parent the notifications services to the widgets

because the frames may be deleted at any time

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-09-18 13:07:00 +03:00
parent 26aaa47acc
commit 21d66f5e75

View file

@ -249,6 +249,7 @@ void ApplicationsWidget::slotRemoveActivated()
if (!plasmaservice) { if (!plasmaservice) {
kWarning() << "Could not get service for" << applicationframe->name; kWarning() << "Could not get service for" << applicationframe->name;
} else { } else {
plasmaservice->setParent(this);
const QVariantMap plasmaserviceargs = plasmaservice->operationParameters("userClosed"); const QVariantMap plasmaserviceargs = plasmaservice->operationParameters("userClosed");
(void)plasmaservice->startOperationCall("userClosed", plasmaserviceargs); (void)plasmaservice->startOperationCall("userClosed", plasmaserviceargs);
} }
@ -286,6 +287,7 @@ void ApplicationsWidget::slotActionReleased()
if (!plasmaservice) { if (!plasmaservice) {
kWarning() << "Could not get service for" << actionframe->name; kWarning() << "Could not get service for" << actionframe->name;
} else { } else {
plasmaservice->setParent(this);
QVariantMap plasmaserviceargs = plasmaservice->operationParameters("invokeAction"); QVariantMap plasmaserviceargs = plasmaservice->operationParameters("invokeAction");
plasmaserviceargs["actionId"] = actionid; plasmaserviceargs["actionId"] = actionid;
(void)plasmaservice->startOperationCall("invokeAction", plasmaserviceargs); (void)plasmaservice->startOperationCall("invokeAction", plasmaserviceargs);