plasma: connect the notifications applet animations directly to QObject::deleteLater() slot

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2023-09-18 14:38:45 +03:00
parent 9a5e68f140
commit c9c9d0d642
4 changed files with 2 additions and 17 deletions

View file

@ -116,18 +116,13 @@ void ApplicationFrame::animateRemove()
disconnect(removewidget, 0, applicationswidget, 0);
disconnect(configurewidget, 0, applicationswidget, 0);
connect(animation, SIGNAL(finished()), this, SLOT(slotAnimationFinished()));
connect(animation, SIGNAL(finished()), this, SLOT(deleteLater()));
animation->setTargetWidget(this);
animation->setProperty("startOpacity", 1.0);
animation->setProperty("targetOpacity", 0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
void ApplicationFrame::slotAnimationFinished()
{
deleteLater();
}
ApplicationsWidget::ApplicationsWidget(QGraphicsItem *parent, NotificationsWidget *notificationswidget)
: QGraphicsWidget(parent),

View file

@ -43,9 +43,6 @@ public:
QString name;
void animateRemove();
private Q_SLOTS:
void slotAnimationFinished();
};

View file

@ -102,18 +102,13 @@ void JobFrame::animateRemove()
disconnect(removewidget, 0, jobswidget, 0);
disconnect(openwidget, 0, jobswidget, 0);
connect(animation, SIGNAL(finished()), this, SLOT(slotAnimationFinished()));
connect(animation, SIGNAL(finished()), this, SLOT(deleteLater()));
animation->setTargetWidget(this);
animation->setProperty("startOpacity", 1.0);
animation->setProperty("targetOpacity", 0.0);
animation->start(QAbstractAnimation::DeleteWhenStopped);
}
void JobFrame::slotAnimationFinished()
{
deleteLater();
}
JobsWidget::JobsWidget(QGraphicsItem *parent, NotificationsWidget *notificationswidget)
: QGraphicsWidget(parent),

View file

@ -44,8 +44,6 @@ public:
QString name;
void animateRemove();
private Q_SLOTS:
void slotAnimationFinished();
};