src/messageLog.cc

changeset 739
152b33a6d51b
parent 662
2f1bd9112408
child 789
4b7306f52bb5
equal deleted inserted replaced
738:16b63398aa1f 739:152b33a6d51b
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

mercurial