MCPcopy Create free account
hub / github.com/MultiMC/Launcher / append

Method append

launcher/launch/LogModel.cpp:35–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 15

read_legacy_releaseMethod · 0.80
foreachFunction · 0.80
QIconThemeMethod · 0.80
findIconHelperMethod · 0.80
virtual_hookMethod · 0.80
addMethod · 0.80
createQueryParametersFunction · 0.80
loginMethod · 0.80
startPollServerMethod · 0.80
foreachFunction · 0.80
joinMethod · 0.80
lockMethod · 0.80

Calls 1

QModelIndexClass · 0.85

Tested by 1

test_copyMethod · 0.64