fix(src/components/notifier/Notifier): destroy call notification when call is terminated

This commit is contained in:
Ronan Abhamon 2017-02-28 10:26:20 +01:00
parent 2ef80f3166
commit 6a47380fc4

View file

@ -163,9 +163,10 @@ void Notifier::showNotification (QObject *notification, int timeout) {
void Notifier::deleteNotification (QVariant notification) {
QObject *instance = notification.value<QObject *>();
instance->property(NOTIFICATION_PROPERTY_TIMER).value<QTimer *>()->stop();
qDebug() << "Delete notification.";
m_mutex.lock();
m_n_instances--;
@ -215,9 +216,9 @@ void Notifier::notifyReceivedCall (const shared_ptr<linphone::Call> &call) {
CallModel *model = CoreManager::getInstance()->getCallsListModel()->getCall(call);
QObject::connect(
model, &CallModel::statusChanged, notification, [notification](CallModel::CallStatus status) {
model, &CallModel::statusChanged, notification, [this, notification](CallModel::CallStatus status) {
if (status == CallModel::CallStatusEnded)
notification->findChild<QQuickWindow *>()->setVisible(false);
deleteNotification(QVariant::fromValue(notification));
}
);