refs #336 CStatusMessage keeps track of which objects have handled it, to avoid duplicate handlings of the same message.

This commit is contained in:
Mathew Sutcliffe
2014-10-12 20:28:13 +01:00
parent 09685e8b37
commit 8992bd734c
5 changed files with 41 additions and 2 deletions

View File

@@ -93,6 +93,12 @@ namespace BlackMisc
* Emitted when a message is logged in a relevant category.
*
* When all slots are disconnected from this signal, the CLogCategoryHandler is allowed to delete itself.
*
* Note that if a message matches more that one category handler, then this signal will be emitted for all of them,
* so if a slot is connected to all of them then it will be called multiple times. Use the methods
* CStatusMessage::markAsHandledBy() and CStatusMessage::wasHandledBy() to detect this case in the slot and avoid
* multiple handlings of the same message. Caveat: for this to work, the slot must take its argument by non-const
* reference, and be connected by Qt::DirectConnection (i.e. the receiver is in the same thread as the CLogHandler).
*/
void messageLogged(const CStatusMessage &message);