mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-26 18:55:38 +08:00
refs #642, as proposed by MS
https://dev.vatsim-germany.org/issues/642#note-4
This commit is contained in:
@@ -111,7 +111,7 @@ namespace BlackCore
|
|||||||
if (cacheAvailable && readMsgs.isFailure())
|
if (cacheAvailable && readMsgs.isFailure())
|
||||||
{
|
{
|
||||||
// error but cache is available, we can continue
|
// error but cache is available, we can continue
|
||||||
readMsgs.clipSeverity(CStatusMessage::SeverityWarning);
|
readMsgs.clampSeverity(CStatusMessage::SeverityWarning);
|
||||||
msgs.push_back(CStatusMessage(this, CStatusMessage::SeverityWarning, "Loading setup failed, but cache is available, will continue"));
|
msgs.push_back(CStatusMessage(this, CStatusMessage::SeverityWarning, "Loading setup failed, but cache is available, will continue"));
|
||||||
msgs.push_back(readMsgs);
|
msgs.push_back(readMsgs);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ namespace BlackMisc
|
|||||||
return c.isEmpty() ? this->getCategoriesAsString() : c;
|
return c.isEmpty() ? this->getCategoriesAsString() : c;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CStatusMessage::clipSeverity(CStatusMessage::StatusSeverity severity)
|
bool CStatusMessage::clampSeverity(CStatusMessage::StatusSeverity severity)
|
||||||
{
|
{
|
||||||
if (this->getSeverity() <= severity) { return false; }
|
if (this->getSeverity() <= severity) { return false; }
|
||||||
this->setSeverity(severity);
|
this->setSeverity(severity);
|
||||||
|
|||||||
@@ -206,7 +206,7 @@ namespace BlackMisc
|
|||||||
StatusSeverity getSeverity() const { return this->m_severity; }
|
StatusSeverity getSeverity() const { return this->m_severity; }
|
||||||
|
|
||||||
//! Clip/reduce severity if higher (more critical)
|
//! Clip/reduce severity if higher (more critical)
|
||||||
bool clipSeverity(StatusSeverity severity);
|
bool clampSeverity(StatusSeverity severity);
|
||||||
|
|
||||||
//! Info or debug, no warning or error
|
//! Info or debug, no warning or error
|
||||||
bool isSeverityInfoOrLess() const { return this->m_severity == SeverityInfo || this->m_severity == SeverityDebug; }
|
bool isSeverityInfoOrLess() const { return this->m_severity == SeverityInfo || this->m_severity == SeverityDebug; }
|
||||||
|
|||||||
@@ -103,11 +103,11 @@ namespace BlackMisc
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void CStatusMessageList::clipSeverity(CStatusMessage::StatusSeverity severity)
|
void CStatusMessageList::clampSeverity(CStatusMessage::StatusSeverity severity)
|
||||||
{
|
{
|
||||||
for (auto &msg : *this)
|
for (auto &msg : *this)
|
||||||
{
|
{
|
||||||
msg.clipSeverity(severity);
|
msg.clampSeverity(severity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ namespace BlackMisc
|
|||||||
void setCategories(const CLogCategoryList &categories);
|
void setCategories(const CLogCategoryList &categories);
|
||||||
|
|
||||||
//! And higher (more critical) severity will be clipped to given severity
|
//! And higher (more critical) severity will be clipped to given severity
|
||||||
void clipSeverity(CStatusMessage::StatusSeverity severity);
|
void clampSeverity(CStatusMessage::StatusSeverity severity);
|
||||||
|
|
||||||
//! Remove warnings and below
|
//! Remove warnings and below
|
||||||
void removeWarningsAndBelow();
|
void removeWarningsAndBelow();
|
||||||
|
|||||||
Reference in New Issue
Block a user