Commit 48f040e5 authored by Marco Martin's avatar Marco Martin
Browse files

support notifications category

support notifications category hint
as a property of Notification object and as a role of the models
parent 41e92ee9
......@@ -249,6 +249,8 @@ QVariant AbstractNotificationsModel::data(const QModelIndex &index, int role) co
case Notifications::ConfigurableRole: return notification.configurable();
case Notifications::ConfigureActionLabelRole: return notification.configureActionLabel();
case Notifications::CategoryRole: return notification.category();
case Notifications::ExpiredRole: return notification.expired();
case Notifications::ReadRole: return;
......@@ -390,6 +390,8 @@ void Notification::Private::processHints(const QVariantMap &hints)
replySubmitButtonText = hints.value(QStringLiteral("x-kde-reply-submit-button-text")).toString();
replySubmitButtonIconName = hints.value(QStringLiteral("x-kde-reply-submit-button-icon-name")).toString();
category = hints.value(QStringLiteral("category")).toString();
// Underscored hints was in use in version 1.1 of the spec but has been
// replaced by dashed hints in version 1.2. We need to support it for
// users of the 1.2 version of the spec.
......@@ -733,6 +735,11 @@ QString Notification::replySubmitButtonIconName() const
return d->replySubmitButtonIconName;
QString Notification::category() const
return d->category;
bool Notification::expired() const
return d->expired;
......@@ -123,6 +123,8 @@ public:
QString replySubmitButtonText() const;
QString replySubmitButtonIconName() const;
QString category() const;
bool expired() const;
void setExpired(bool expired);
......@@ -98,6 +98,8 @@ public:
QString replySubmitButtonText;
QString replySubmitButtonIconName;
QString category;
QList<QUrl> urls;
QVariantMap hints = QVariantMap();
......@@ -280,6 +280,7 @@ public:
ReplyPlaceholderTextRole, ///< A custom placeholder text for the reply action, e.g. "Reply to Max...". @since 5.18
ReplySubmitButtonTextRole, ///< A custom text for the reply submit button, e.g. "Submit Comment". @since 5.18
ReplySubmitButtonIconNameRole, ///< A custom icon name for the reply submit button. @since 5.18
CategoryRole, ///< The (optional) category of the notification. Notifications can optionally have a type indicator. Although neither client or nor server must support this, some may choose to. Those servers implementing categories may use them to intelligently display the notification in a certain way, or group notifications of similar types. @since 5.21
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment