From: Matthieu Gallien Date: Mon, 13 Feb 2023 22:07:00 +0000 (+0100) Subject: expose some properties of OCC::Activity gadget class X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~10^2~42^2~12 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=f51af1734d8aa5af791dfc9ac6e7f5fd54d04502;p=nextcloud-desktop.git expose some properties of OCC::Activity gadget class Signed-off-by: Matthieu Gallien --- diff --git a/src/gui/owncloudgui.cpp b/src/gui/owncloudgui.cpp index 713fca59f..370e850e6 100644 --- a/src/gui/owncloudgui.cpp +++ b/src/gui/owncloudgui.cpp @@ -128,6 +128,7 @@ ownCloudGui::ownCloudGui(Application *parent) qmlRegisterType("com.nextcloud.desktopclient", 1, 0, "SortedShareModel"); qmlRegisterType("com.nextcloud.desktopclient", 1, 0, "SyncConflictsModel"); qmlRegisterUncreatableType("com.nextcloud.desktopclient", 1, 0, "QAbstractItemModel", "QAbstractItemModel"); + qmlRegisterUncreatableType("com.nextcloud.desktopclient", 1, 0, "Activity", "Activity"); qmlRegisterUncreatableType("com.nextcloud.desktopclient", 1, 0, "UnifiedSearchResultsListModel", "UnifiedSearchResultsListModel"); qmlRegisterUncreatableType("com.nextcloud.desktopclient", 1, 0, "UserStatus", "Access to Status enum"); diff --git a/src/gui/tray/activitydata.h b/src/gui/tray/activitydata.h index 88a8948d3..c5517d116 100644 --- a/src/gui/tray/activitydata.h +++ b/src/gui/tray/activitydata.h @@ -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;