expose some properties of OCC::Activity gadget class

Signed-off-by: Matthieu Gallien <matthieu.gallien@nextcloud.com>
This commit is contained in:
Matthieu Gallien 2023-02-13 23:07:00 +01:00
parent ce69856bfa
commit f51af1734d
No known key found for this signature in database
GPG key ID: 7D0F74F05C22F553
2 changed files with 20 additions and 0 deletions

View file

@ -128,6 +128,7 @@ ownCloudGui::ownCloudGui(Application *parent)
qmlRegisterType<SortedShareModel>("com.nextcloud.desktopclient", 1, 0, "SortedShareModel");
qmlRegisterType<SyncConflictsModel>("com.nextcloud.desktopclient", 1, 0, "SyncConflictsModel");
qmlRegisterUncreatableType<QAbstractItemModel>("com.nextcloud.desktopclient", 1, 0, "QAbstractItemModel", "QAbstractItemModel");
qmlRegisterUncreatableType<Activity>("com.nextcloud.desktopclient", 1, 0, "Activity", "Activity");
qmlRegisterUncreatableType<UnifiedSearchResultsListModel>("com.nextcloud.desktopclient", 1, 0, "UnifiedSearchResultsListModel", "UnifiedSearchResultsListModel");
qmlRegisterUncreatableType<UserStatus>("com.nextcloud.desktopclient", 1, 0, "UserStatus", "Access to Status enum");

View file

@ -108,6 +108,22 @@ public:
QString messageId;
QString messageSent;
QString userAvatar;
[[nodiscard]] bool operator==(const TalkNotificationData &other) const
{
return conversationToken == other.conversationToken &&
messageId == other.messageId &&
messageSent == other.messageSent &&
userAvatar == other.userAvatar;
}
[[nodiscard]] bool operator!=(const TalkNotificationData &other) const
{
return conversationToken != other.conversationToken ||
messageId != other.messageId ||
messageSent != other.messageSent ||
userAvatar != other.userAvatar;
}
};
/* ==================================================================== */
@ -120,6 +136,9 @@ public:
class Activity
{
Q_GADGET
Q_PROPERTY(OCC::Activity::Type type MEMBER _type)
Q_PROPERTY(OCC::TalkNotificationData talkNotificationData MEMBER _talkNotificationData)
Q_PROPERTY(QVariantMap subjectRichParameters MEMBER _subjectRichParameters)
public:
using Identifier = QPair<qlonglong, QString>;