Add == operator for notifications
This commit is contained in:
parent
de42acd190
commit
728a6a27dc
|
@ -52,6 +52,7 @@ public:
|
||||||
const ChronoUtilities::DateTime &creationTime() const;
|
const ChronoUtilities::DateTime &creationTime() const;
|
||||||
static constexpr inline NotificationType worstNotificationType();
|
static constexpr inline NotificationType worstNotificationType();
|
||||||
static void sortByTime(NotificationList ¬ifications);
|
static void sortByTime(NotificationList ¬ifications);
|
||||||
|
bool operator==(const Notification &other) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
NotificationType m_type;
|
NotificationType m_type;
|
||||||
|
@ -100,6 +101,15 @@ constexpr NotificationType Notification::worstNotificationType()
|
||||||
return NotificationType::Critical;
|
return NotificationType::Critical;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Returns whether the current instance equals \a other.
|
||||||
|
* \remarks The creation time is *not* taken into account.
|
||||||
|
*/
|
||||||
|
inline bool Notification::operator==(const Notification &other) const
|
||||||
|
{
|
||||||
|
return m_type == other.m_type && m_msg == other.m_msg && m_context == other.m_context;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // NOTIFICATION_H
|
#endif // NOTIFICATION_H
|
||||||
|
|
Loading…
Reference in New Issue