Mobile: start message timer on startup

Since the timer will be started on first message anyway, we might
just start it at application startup.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-01-18 12:49:22 +01:00 committed by Dirk Hohndel
parent 84b96ac2ae
commit 3d02edf61e

View file

@ -115,6 +115,7 @@ QMLManager::QMLManager() : m_locationServiceEnabled(false),
{
m_instance = this;
m_lastDevicePixelRatio = qApp->devicePixelRatio();
timer.start();
connect(qobject_cast<QApplication *>(QApplication::instance()), &QApplication::applicationStateChanged, this, &QMLManager::applicationStateChanged);
QString libdcLogFileName = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation).first() + "/libdivecomputer.log";
@ -1323,8 +1324,6 @@ void QMLManager::setLogText(const QString &logText)
void QMLManager::appendTextToLog(const QString &newText)
{
if (!timer.isValid())
timer.start();
qDebug() << QString::number(timer.elapsed() / 1000.0,'f', 3) + ": " + newText;
}