void ThreadResult::reportErr(const ErrorLogger::ErrorMessage &msg) { QMutexLocker locker(&mutex); QList<unsigned int> lines; QStringList files; for (std::list<ErrorLogger::ErrorMessage::FileLocation>::const_iterator tok = msg._callStack.begin(); tok != msg._callStack.end(); ++tok) { files << QString((*tok).getfile(false).c_str()); lines << (*tok).line; } ErrorItem item; item.file = QString(callStackToString(msg._callStack).c_str()); item.files = files; item.id = QString(msg._id.c_str()); item.lines = lines; item.summary = QString::fromStdString(msg.shortMessage()); item.message = QString::fromStdString(msg.verboseMessage()); item.severity = msg._severity; item.inconclusive = msg._inconclusive; if (msg._severity != Severity::debug) emit Error(item); else emit DebugError(item); }
ErrorItem::ErrorItem(const ErrorLogger::ErrorMessage &errmsg) : errorId(QString::fromStdString(errmsg._id)) , severity(errmsg._severity) , inconclusive(errmsg._inconclusive) , summary(QString::fromStdString(errmsg.shortMessage())) , message(QString::fromStdString(errmsg.verboseMessage())) , cwe(errmsg._cwe.id) , symbolNames(QString::fromStdString(errmsg.symbolNames())) { for (std::list<ErrorLogger::ErrorMessage::FileLocation>::const_iterator loc = errmsg._callStack.begin(); loc != errmsg._callStack.end(); ++loc) { errorPath << QErrorPathItem(*loc); } }