Changeset 90687 in vbox
- Timestamp:
- Aug 15, 2021 2:08:18 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
- Files:
-
- 2 edited
-
UINotificationObjects.cpp (modified) (1 diff)
-
UINotificationObjects.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90679 r90687 40 40 41 41 /* static */ 42 QMap<QString, QUuid> UINotificationMessage::m_messages = QMap<QString, QUuid>(); 43 44 UINotificationMessage::UINotificationMessage(const QString &strName, 45 const QString &strDetails, 46 const QString &strInternalName) 47 : UINotificationSimple(strName, 48 strDetails, 49 strInternalName) 50 { 51 } 52 53 UINotificationMessage::~UINotificationMessage() 54 { 55 /* Remove message from known: */ 56 m_messages.remove(m_strInternalName); 57 } 58 59 /* static */ 42 60 void UINotificationMessage::createMessage(const QString &strName, 43 61 const QString &strDetails, 44 const QString &strInternalName )62 const QString &strInternalName /* = QString() */) 45 63 { 46 64 /* Check if message suppressed: */ 47 65 if (isSuppressed(strInternalName)) 48 66 return; 67 /* Check if message already exists: */ 68 if (m_messages.contains(strInternalName)) 69 return; 49 70 50 71 /* Create message finally: */ 51 gpNotificationCenter->append(new UINotificationMessage(strName, 52 strDetails, 53 strInternalName)); 54 } 55 72 m_messages[strInternalName] = gpNotificationCenter->append(new UINotificationMessage(strName, 73 strDetails, 74 strInternalName)); 75 } 76 77 /* static */ 78 void UINotificationMessage::destroyMessage(const QString &strInternalName) 79 { 80 /* Check if message really exists: */ 81 if (!m_messages.contains(strInternalName)) 82 return; 83 84 /* Destroy message finally: */ 85 gpNotificationCenter->revoke(m_messages.value(strInternalName)); 86 m_messages.remove(strInternalName); 87 } 56 88 57 89 /********************************************************************************************************************************* -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90679 r90687 58 58 * @param strInternalName Brings the message internal name. */ 59 59 UINotificationMessage(const QString &strName, 60 const QString &strDetails, 61 const QString &strInternalName) 62 : UINotificationSimple(strName, 63 strDetails, 64 strInternalName) 65 {} 60 const QString &strDetails, 61 const QString &strInternalName); 62 /** Destructs message notification-object. */ 63 virtual ~UINotificationMessage() /* override final */; 66 64 67 65 private: … … 73 71 static void createMessage(const QString &strName, 74 72 const QString &strDetails, 75 const QString &strInternalName); 73 const QString &strInternalName = QString()); 74 /** Destroys message. 75 * @param strInternalName Brings the message internal name. */ 76 static void destroyMessage(const QString &strInternalName); 77 78 /** Holds the IDs of messages registered. */ 79 static QMap<QString, QUuid> m_messages; 76 80 77 81 /** Holds the message name. */
Note:
See TracChangeset
for help on using the changeset viewer.

