summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebenginenotification.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/api/qwebenginenotification.cpp')
-rw-r--r--src/core/api/qwebenginenotification.cpp54
1 files changed, 12 insertions, 42 deletions
diff --git a/src/core/api/qwebenginenotification.cpp b/src/core/api/qwebenginenotification.cpp
index ba9739b35..0b1d48ce9 100644
--- a/src/core/api/qwebenginenotification.cpp
+++ b/src/core/api/qwebenginenotification.cpp
@@ -58,8 +58,8 @@ using QtWebEngineCore::UserNotificationController;
Web engine notifications are passed to the user in the
\l QWebEngineProfile::setNotificationPresenter() and
- \l QQuickWebEngineProfile::userNotification() calls and the
- \l WebEngineProfile::userNotification() signal.
+ \l QQuickWebEngineProfile::presentNotification() calls and the
+ \l WebEngineProfile::presentNotification() signal.
*/
class QWebEngineNotificationPrivate : public UserNotificationController::Client {
@@ -86,14 +86,6 @@ public:
QWebEngineNotification *q;
};
-
-/*!
- Creates a null QWebEngineNotification.
-
- \sa isNull()
-*/
-QWebEngineNotification::QWebEngineNotification() { }
-
/*! \internal
*/
QWebEngineNotification::QWebEngineNotification(const QSharedPointer<UserNotificationController> &controller)
@@ -102,25 +94,10 @@ QWebEngineNotification::QWebEngineNotification(const QSharedPointer<UserNotifica
/*! \internal
*/
-QWebEngineNotification::QWebEngineNotification(const QWebEngineNotification &other)
- : QObject()
- , d_ptr(new QWebEngineNotificationPrivate(this, other.d_ptr->controller))
-{ }
-
-/*! \internal
-*/
QWebEngineNotification::~QWebEngineNotification()
{
}
-/*! \internal
-*/
-const QWebEngineNotification &QWebEngineNotification::operator=(const QWebEngineNotification &other)
-{
- d_ptr.reset(new QWebEngineNotificationPrivate(this, other.d_ptr->controller));
- return *this;
-}
-
/*!
Returns \c true if the two notifications belong to the same message chain.
That is, if their tag() and origin() are the same. This means one is
@@ -128,13 +105,15 @@ const QWebEngineNotification &QWebEngineNotification::operator=(const QWebEngine
\sa tag(), origin()
*/
-bool QWebEngineNotification::matches(const QWebEngineNotification &other) const
+bool QWebEngineNotification::matches(const QWebEngineNotification *other) const
{
+ if (!other)
+ return false;
if (!d_ptr)
- return !other.d_ptr;
- if (!other.d_ptr)
+ return !other->d_ptr;
+ if (!other->d_ptr)
return false;
- return tag() == other.tag() && origin() == other.origin();
+ return tag() == other->tag() && origin() == other->origin();
}
/*!
@@ -187,15 +166,14 @@ QUrl QWebEngineNotification::origin() const
}
/*!
- \property QWebEngineNotification::icon
- \brief The icon to be shown with the notification.
+ Returns the icon to be shown with the notification.
- If no icon is set by the sender, an null QIcon is returned.
+ If no icon is set by the sender, a null QImage is returned.
*/
-QIcon QWebEngineNotification::icon() const
+QImage QWebEngineNotification::icon() const
{
Q_D(const QWebEngineNotification);
- return d ? d->controller->icon() : QIcon();
+ return d ? d->controller->icon() : QImage();
}
/*!
@@ -224,14 +202,6 @@ Qt::LayoutDirection QWebEngineNotification::direction() const
}
/*!
- Returns \c true if the notification is not a default constructed null notification.
-*/
-bool QWebEngineNotification::isValid() const
-{
- return !d_ptr.isNull();
-}
-
-/*!
Creates and dispatches a JavaScript \e {show event} on notification.
Should be called by the notification platform when the notification has been shown to user.