19 #include <QTextStream>
24 IStatus::Severity MultiStatus::GetMaxSeverity(
const QList<IStatus::Pointer>& children)
const
27 for (
int i = 0; i < children.size(); i++)
29 Q_ASSERT(children[i]);
30 Severity severity = children[i]->GetSeverity();
31 if (severity > maxSeverity)
32 maxSeverity = severity;
38 const QList<IStatus::Pointer>& newChildren,
40 :
Status(OK_TYPE, pluginId, code, message, sl), children(newChildren)
46 const QList<IStatus::Pointer>& newChildren,
47 const QString& message,
const ctkException& exception,
49 :
Status(OK_TYPE, pluginId, code, message, exception, sl), children(newChildren)
56 :
Status(OK_TYPE, pluginId, code, message, sl)
61 const QString& message,
const ctkException& exception,
63 :
Status(OK_TYPE, pluginId, code, message, exception, sl)
70 children.push_back(status);
71 Severity newSev = status->GetSeverity();
81 QList<IStatus::Pointer> statuses(status->GetChildren());
82 for (
int i = 0; i < statuses.size(); i++)
84 this->
Add(statuses[i]);
101 if (!status->IsMultiStatus())
114 QTextStream buf(&str);
116 for (
int i = 0; i < children.size(); i++)
122 buf << children[i]->ToString();
bool IsMultiStatus() const override
QString ToString() const override
QString ToString() const override
virtual void SetSeverity(const Severity &severity)
Severity GetSeverity() const override
void AddAll(IStatus::Pointer status)
MultiStatus(const QString &pluginId, int code, const QList< IStatus::Pointer > &newChildren, const QString &message, const SourceLocation &sl)
void Add(IStatus::Pointer status)
QList< IStatus::Pointer > GetChildren() const override
void Merge(const IStatus::Pointer &status)