36 connect (m_ticker, SIGNAL (timeout()), this, SLOT (tick())); |
36 connect (m_ticker, SIGNAL (timeout()), this, SLOT (tick())); |
37 } |
37 } |
38 |
38 |
39 // ============================================================================= |
39 // ============================================================================= |
40 // |
40 // |
41 MessageManager::Line::Line (QString text) : |
41 MessageManager::Line::Line (String text) : |
42 text (text), |
42 text (text), |
43 alpha (1.0f), |
43 alpha (1.0f), |
44 expiry (QDateTime::currentDateTime().addSecs (g_expiry)) {} |
44 expiry (QDateTime::currentDateTime().addSecs (g_expiry)) {} |
45 |
45 |
46 // ============================================================================= |
46 // ============================================================================= |
69 } |
69 } |
70 |
70 |
71 // ============================================================================= |
71 // ============================================================================= |
72 // Add a line to the message manager. |
72 // Add a line to the message manager. |
73 // |
73 // |
74 void MessageManager::addLine (QString line) |
74 void MessageManager::addLine (String line) |
75 { |
75 { |
76 // If there's too many entries, pop the excess out |
76 // If there's too many entries, pop the excess out |
77 while (m_lines.size() >= g_maxMessages) |
77 while (m_lines.size() >= g_maxMessages) |
78 m_lines.removeFirst(); |
78 m_lines.removeFirst(); |
79 |
79 |
116 return m_lines; |
116 return m_lines; |
117 } |
117 } |
118 |
118 |
119 // ============================================================================= |
119 // ============================================================================= |
120 // |
120 // |
121 void printToLog (const QString& msg) |
121 void printToLog (const String& msg) |
122 { |
122 { |
123 for (QString& a : msg.split ("\n", QString::SkipEmptyParts)) |
123 for (String& a : msg.split ("\n", String::SkipEmptyParts)) |
124 { |
124 { |
125 if (g_win != null) |
125 if (g_win != null) |
126 g_win->addMessage (a); |
126 g_win->addMessage (a); |
127 |
127 |
128 // Also print it to stdout |
128 // Also print it to stdout |