src/messageLog.cpp

changeset 1063
1f15c52c11f6
parent 1014
f0a8ecb6a357
child 1065
c8ecddbd99e9
equal deleted inserted replaced
1062:4119185b56ca 1063:1f15c52c11f6
76 // Add a line to the message manager. 76 // Add a line to the message manager.
77 // 77 //
78 void MessageManager::addLine (QString line) 78 void MessageManager::addLine (QString line)
79 { 79 {
80 // If there's too many entries, pop the excess out 80 // If there's too many entries, pop the excess out
81 while (m_lines.size() >= MaxMessages) 81 while (length(m_lines) >= MaxMessages)
82 m_lines.removeFirst(); 82 m_lines.removeFirst();
83 83
84 m_lines << Line (line); 84 m_lines << Line (line);
85 85
86 // Update the renderer view 86 // Update the renderer view
98 if (m_lines.isEmpty()) 98 if (m_lines.isEmpty())
99 return; 99 return;
100 100
101 bool changed = false; 101 bool changed = false;
102 102
103 for (int i = 0; i < m_lines.size(); ++i) 103 for (int i = 0; i < length(m_lines); ++i)
104 { 104 {
105 bool lineChanged; 105 bool lineChanged;
106 106
107 if (not m_lines[i].update (lineChanged)) 107 if (not m_lines[i].update (lineChanged))
108 m_lines.removeAt (i--); 108 m_lines.removeAt (i--);

mercurial