mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 06:55:59 +03:00
Deallocate call notification dialog objects when closed
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
This commit is contained in:
parent
4fcef4edbc
commit
5a56584fba
3 changed files with 14 additions and 0 deletions
|
@ -205,6 +205,12 @@ void Systray::setupContextMenu()
|
|||
});
|
||||
}
|
||||
|
||||
void Systray::destroyDialog(QQuickWindow *dialog) const
|
||||
{
|
||||
dialog->destroy();
|
||||
dialog->deleteLater();
|
||||
}
|
||||
|
||||
void Systray::createCallDialog(const Activity &callNotification, const AccountStatePtr accountState)
|
||||
{
|
||||
qCDebug(lcSystray) << "Starting a new call dialog for notification with id: " << callNotification._id << "with text: " << callNotification._subject;
|
||||
|
@ -244,6 +250,8 @@ void Systray::createCallDialog(const Activity &callNotification, const AccountSt
|
|||
return;
|
||||
}
|
||||
|
||||
// This call dialog gets deallocated on close conditions
|
||||
// by a call from the QML side to the destroyDialog slot
|
||||
callDialog->createWithInitialProperties(initialProperties);
|
||||
_callsAlreadyNotified.insert(callNotification._id);
|
||||
}
|
||||
|
|
|
@ -118,6 +118,10 @@ public slots:
|
|||
void positionWindowAtScreenCenter(QQuickWindow *window) const;
|
||||
void positionNotificationWindow(QQuickWindow *window) const;
|
||||
|
||||
// Do not use this for QQuickWindow components managed by the QML engine,
|
||||
// only for those managed by the C++ engine
|
||||
void destroyDialog(QQuickWindow *window) const;
|
||||
|
||||
void showWindow(WindowPosition position = WindowPosition::Default);
|
||||
void hideWindow();
|
||||
|
||||
|
|
|
@ -48,6 +48,8 @@ Window {
|
|||
callStateChecker.checking = false;
|
||||
ringSound.stop();
|
||||
root.close();
|
||||
|
||||
Systray.destroyDialog(root);
|
||||
}
|
||||
|
||||
width: root.windowWidth
|
||||
|
|
Loading…
Reference in a new issue