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 (length(m_lines) >= MaxMessages) |
81 while (countof(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 < length(m_lines); ++i) |
103 for (int i = 0; i < countof(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--); |