mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-05 09:15:34 +08:00
refs #567 CStatusMessageList::setCategories and related methods.
This commit is contained in:
@@ -129,6 +129,12 @@ namespace BlackMisc
|
||||
//! Add categories
|
||||
void addCategories(const CLogCategoryList &categories) { this->m_categories.push_back(categories); }
|
||||
|
||||
//! Reset category
|
||||
void setCategory(const CLogCategory &category) { this->m_categories = CLogCategoryList { category }; }
|
||||
|
||||
//! Reset categories
|
||||
void setCategories(const CLogCategoryList &categories) { this->m_categories = categories; }
|
||||
|
||||
//! Representing icon
|
||||
CIcon toIcon() const { return convertToIcon(*this); }
|
||||
|
||||
|
||||
@@ -58,6 +58,22 @@ namespace BlackMisc
|
||||
}
|
||||
}
|
||||
|
||||
void CStatusMessageList::setCategory(const CLogCategory &category)
|
||||
{
|
||||
for (auto &msg : *this)
|
||||
{
|
||||
msg.setCategory(category);
|
||||
}
|
||||
}
|
||||
|
||||
void CStatusMessageList::setCategories(const CLogCategoryList &categories)
|
||||
{
|
||||
for (auto &msg : *this)
|
||||
{
|
||||
msg.setCategories(categories);
|
||||
}
|
||||
}
|
||||
|
||||
CStatusMessageList CStatusMessageList::fromDatabaseJson(const QJsonArray &array)
|
||||
{
|
||||
CStatusMessageList messages;
|
||||
|
||||
@@ -58,6 +58,12 @@ namespace BlackMisc
|
||||
//! Add some categories to all messages in the list
|
||||
void addCategories(const CLogCategoryList &categories);
|
||||
|
||||
//! Reset the category of all messages in the list
|
||||
void setCategory(const CLogCategory &category);
|
||||
|
||||
//! Reset the categories of all messages in the list
|
||||
void setCategories(const CLogCategoryList &categories);
|
||||
|
||||
//! From our database JSON format
|
||||
static CStatusMessageList fromDatabaseJson(const QJsonArray &array);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user