From db861569efb1ecd105762ef9583a10fa354dae57 Mon Sep 17 00:00:00 2001 From: Roland Rossgotterer Date: Tue, 12 Mar 2019 13:19:59 +0100 Subject: [PATCH] Move grouped Notifications out of NotificationFlag enum Those were convenience helpers that do not belong to the enum itself. --- src/blackmisc/audio/notificationsounds.h | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/blackmisc/audio/notificationsounds.h b/src/blackmisc/audio/notificationsounds.h index eb25d5272..229f5822f 100644 --- a/src/blackmisc/audio/notificationsounds.h +++ b/src/blackmisc/audio/notificationsounds.h @@ -48,15 +48,24 @@ namespace BlackMisc NotificationNoAudioTransmission = 1 << 8, PTTClickKeyDown = 1 << 9, PTTClickKeyUp = 1 << 10, - AllTextNotifications = NotificationTextMessagePrivate | NotificationTextCallsignMentioned | NotificationTextMessageSupervisor, - AllLoginNotifications = NotificationLogin | NotificationLogoff, - AllVoiceRoomNotifications = NotificationVoiceRoomJoined | NotificationVoiceRoomLeft | NotificationNoAudioTransmission, - AllNotifications = NotificationError | AllTextNotifications | AllLoginNotifications | AllVoiceRoomNotifications, - DefaultNotifications = NotificationError | AllTextNotifications | AllLoginNotifications | AllVoiceRoomNotifications, - All = AllNotifications | PTTClickKeyDown | PTTClickKeyUp }; Q_DECLARE_FLAGS(Notification, NotificationFlag) + //! All text notification flags + constexpr static Notification AllTextNotifications = Notification(NotificationTextMessagePrivate | NotificationTextCallsignMentioned | NotificationTextMessageSupervisor); + + //! All login notification flags + constexpr static Notification AllLoginNotifications = Notification(NotificationLogin | NotificationLogoff); + + //! All voice room notification flags + constexpr static Notification AllVoiceRoomNotifications = Notification(NotificationVoiceRoomJoined | NotificationVoiceRoomLeft); + + //! All notification flags + constexpr static Notification AllNotifications = Notification(NotificationError | AllTextNotifications | AllLoginNotifications | AllVoiceRoomNotifications); + + //! Default notification flags + constexpr static Notification DefaultNotifications = Notification(AllNotifications); + //! As string static const QString &flagToString(NotificationFlag notification);