mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 02:35:33 +08:00
refs #618, allow to directly create validation messages
Needed frequently, easier than always to join categories
This commit is contained in:
@@ -96,10 +96,14 @@ namespace BlackMisc
|
||||
m_severity = severity;
|
||||
}
|
||||
|
||||
CStatusMessage::CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const QString &message)
|
||||
CStatusMessage::CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const QString &message, bool verification)
|
||||
: CStatusMessage(severity, message)
|
||||
{
|
||||
m_categories = categories;
|
||||
if (verification)
|
||||
{
|
||||
this->addVerificationCategory();
|
||||
}
|
||||
}
|
||||
|
||||
CStatusMessage::CStatusMessage(QtMsgType type, const QMessageLogContext &context, const QString &message)
|
||||
@@ -227,6 +231,11 @@ namespace BlackMisc
|
||||
return this->m_handledByObjects.contains(quintptr(object));
|
||||
}
|
||||
|
||||
void CStatusMessage::addVerificationCategory()
|
||||
{
|
||||
this->addCategory(CLogCategory::verification());
|
||||
}
|
||||
|
||||
QString CStatusMessage::convertToQString(bool /** i18n */) const
|
||||
{
|
||||
|
||||
|
||||
@@ -188,8 +188,8 @@ namespace BlackMisc
|
||||
//! Constructor
|
||||
CStatusMessage(StatusSeverity severity, const QString &message);
|
||||
|
||||
//! Constructor
|
||||
CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const QString &message);
|
||||
//! Constructor, also a verification messsage can be directly created
|
||||
CStatusMessage(const CLogCategoryList &categories, StatusSeverity severity, const QString &message, bool verification = false);
|
||||
|
||||
//! Construct from a Qt logging triple
|
||||
//! \sa QtMessageHandler
|
||||
@@ -267,6 +267,9 @@ namespace BlackMisc
|
||||
//! Add category
|
||||
void addCategory(const CLogCategory &category) { this->m_categories.push_back(category); }
|
||||
|
||||
//! Adds verification as category
|
||||
void addVerificationCategory();
|
||||
|
||||
//! Add categories
|
||||
void addCategories(const CLogCategoryList &categories) { this->m_categories.push_back(categories); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user