summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
diff options
context:
space:
mode:
authorKirill Burtsev <kirill.burtsev@qt.io>2019-02-27 19:02:50 +0100
committerAapo Keskimolo <aapo.keskimolo@qt.io>2019-03-19 20:40:40 +0000
commit0f30fe4b6ae26b4797272926318c31b1f07acc20 (patch)
tree70aa42b8f45dd9613bdb12cfda6220509f32361c /src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
parent10e65c418625f586430d3033e71bd3b4d69b7420 (diff)
Notification API cleanup: direction type, parameter and method names
Change-Id: I0349f3eea0028a4df917af8599c073227e0d0ec1 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webenginewidgets/api/qwebenginenotificationpresenter.cpp')
-rw-r--r--src/webenginewidgets/api/qwebenginenotificationpresenter.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp b/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
index c15a80373..da97c4662 100644
--- a/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
+++ b/src/webenginewidgets/api/qwebenginenotificationpresenter.cpp
@@ -57,11 +57,15 @@ DefaultNotificationPresenter::~DefaultNotificationPresenter()
void DefaultNotificationPresenter::show(const QWebEngineNotification &notification)
{
- if (!m_activeNotification.isNull())
+ if (m_activeNotification.isValid()) {
m_activeNotification.close();
+ m_activeNotification.disconnect(this);
+ }
+
m_activeNotification = notification;
+
#ifndef QT_NO_SYSTEMTRAYICON
- if (m_systemTrayIcon) {
+ if (m_activeNotification.isValid() && m_systemTrayIcon) {
m_systemTrayIcon->show();
QIcon icon = notification.icon();
if (!icon.isNull())
@@ -76,7 +80,7 @@ void DefaultNotificationPresenter::show(const QWebEngineNotification &notificati
void DefaultNotificationPresenter::messageClicked()
{
- if (!m_activeNotification.isNull())
+ if (m_activeNotification.isValid())
m_activeNotification.click();
}