MCPcopy Create free account
hub / github.com/FreesmTeam/FreesmLauncher / append

Method append

launcher/launch/LogModel.cpp:33–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void LogModel::append(MessageLevel::Enum level, QString line)
34{
35 if (m_suspended) {
36 return;
37 }
38 int lineNum = (m_firstLine + m_numLines) % m_maxLines;
39 // overflow
40 if (m_numLines == m_maxLines) {
41 if (m_stopOnOverflow) {
42 // nothing more to do, the buffer is full
43 return;
44 }
45 beginRemoveRows(QModelIndex(), 0, 0);
46 m_firstLine = (m_firstLine + 1) % m_maxLines;
47 m_numLines--;
48 endRemoveRows();
49 } else if (m_numLines == m_maxLines - 1 && m_stopOnOverflow) {
50 level = MessageLevel::Fatal;
51 line = m_overflowMessage;
52 }
53 beginInsertRows(QModelIndex(), m_numLines, m_numLines);
54 m_numLines++;
55 m_content[lineNum].level = level;
56 m_content[lineNum].line = line;
57 endInsertRows();
58}
59
60void LogModel::suspend(bool suspend)
61{

Callers 15

read_legacy_releaseMethod · 0.80
QDCSSMethod · 0.80
readStringMethod · 0.80
readNumberMethod · 0.80
lockMethod · 0.80
addLinkedInstanceIdMethod · 0.80
toListFunction · 0.80
fromListFunction · 0.80
toJsonArrayFunction · 0.80
requireIsArrayOfFunction · 0.80
ensureIsArrayOfFunction · 0.80
addProblemMethod · 0.80

Calls 1

QModelIndexClass · 0.85

Tested by 13

test_copyMethod · 0.64
test_linkMethod · 0.64
test_hard_linkMethod · 0.64
loadIndexedPackMethod · 0.64