forked from qt-creator/qt-creator
ProjectExplorer: Prevent creating large issues in SanitizerParser
E.g. leak info can get huge, and our task view is not suitable for displaying items of such size. Change-Id: Ic22444b23d96fd2a4662ec6c2f3f20f9d8b34816 Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#ifdef WITH_TESTS
|
#ifdef WITH_TESTS
|
||||||
@@ -134,6 +135,12 @@ void SanitizerParser::flush()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
setDetailsFormat(m_task, m_linkSpecs);
|
setDetailsFormat(m_task, m_linkSpecs);
|
||||||
|
static const int maxLen = 50;
|
||||||
|
if (m_task.details.length() > maxLen) {
|
||||||
|
const auto cutOffIt = std::next(m_task.details.begin(), maxLen);
|
||||||
|
m_task.details.insert(cutOffIt, "...");
|
||||||
|
m_task.details.erase(std::next(cutOffIt), std::prev(m_task.details.end()));
|
||||||
|
}
|
||||||
scheduleTask(m_task, m_task.details.count());
|
scheduleTask(m_task, m_task.details.count());
|
||||||
m_task.clear();
|
m_task.clear();
|
||||||
m_linkSpecs.clear();
|
m_linkSpecs.clear();
|
||||||
|
Reference in New Issue
Block a user