--- a/src/messageLog.cpp Thu Jan 04 19:40:52 2018 +0200 +++ b/src/messageLog.cpp Thu Jan 04 19:44:26 2018 +0200 @@ -31,28 +31,28 @@ // ------------------------------------------------------------------------------------------------- // -MessageManager::MessageManager (QObject* parent) : - QObject (parent) +MessageManager::MessageManager(QObject* parent) : + QObject(parent) { m_ticker = new QTimer; - m_ticker->start (100); - connect (m_ticker, SIGNAL (timeout()), this, SLOT (tick())); + m_ticker->start(100); + connect(m_ticker, SIGNAL(timeout()), this, SLOT(tick())); } // ------------------------------------------------------------------------------------------------- // -MessageManager::Line::Line (QString text) : - text (text), - alpha (1.0f), - expiry (QDateTime::currentDateTime().addMSecs (ExpireTime)) {} +MessageManager::Line::Line(QString text) : + text(text), + alpha(1.0f), + expiry(QDateTime::currentDateTime().addMSecs(ExpireTime)) {} // ------------------------------------------------------------------------------------------------- // -bool MessageManager::Line::update (bool& changed) +bool MessageManager::Line::update(bool& changed) { changed = false; QDateTime now = QDateTime::currentDateTime(); - int msec = now.msecsTo (expiry); + int msec = now.msecsTo(expiry); if (now >= expiry) { @@ -64,7 +64,7 @@ if (msec <= FadeTime) { // Message line has not expired but is fading out - alpha = ( (float) msec) / FadeTime; + alpha = ((float) msec) / FadeTime; changed = true; } @@ -75,13 +75,13 @@ // // Add a line to the message manager. // -void MessageManager::addLine (QString line) +void MessageManager::addLine(QString line) { // If there's too many entries, pop the excess out while (m_lines.size() >= MaxMessages) m_lines.removeFirst(); - m_lines << Line (line); + m_lines << Line(line); // Update the renderer view if (renderer()) @@ -104,8 +104,8 @@ { bool lineChanged; - if (not m_lines[i].update (lineChanged)) - m_lines.removeAt (i--); + if (not m_lines[i].update(lineChanged)) + m_lines.removeAt(i--); changed |= lineChanged; } @@ -126,21 +126,21 @@ return m_renderer; } -void MessageManager::setRenderer (GLRenderer* renderer) +void MessageManager::setRenderer(GLRenderer* renderer) { m_renderer = renderer; } // ============================================================================= // -void printToLog (const QString& msg) +void printToLog(const QString& msg) { - for (QString& a : msg.split ("\n", QString::SkipEmptyParts)) + for (QString& a : msg.split("\n", QString::SkipEmptyParts)) { if (g_win) - g_win->addMessage (a); + g_win->addMessage(a); // Also print it to stdout - fprint (stdout, "%1\n", a); + fprint(stdout, "%1\n", a); } }