diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2016-04-18 06:15:54 -0700 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2016-04-19 04:20:12 -0700 |
commit | fe62da3a6b52b1367a8484ddeabc0401d1c2c0f2 (patch) | |
tree | 53b6f781e08633aae1f376aaf948286ebbea6681 /mobile-widgets/qmlmanager.cpp | |
parent | 9607ff6c93e329c1f0535675eeec18871cc2f0d7 (diff) | |
download | subsurface-fe62da3a6b52b1367a8484ddeabc0401d1c2c0f2.tar.gz |
QML UI: always show the time stamp when logging data
This should help understand some of the issues with git storage and GPS
fixes better.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets/qmlmanager.cpp')
-rw-r--r-- | mobile-widgets/qmlmanager.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/mobile-widgets/qmlmanager.cpp b/mobile-widgets/qmlmanager.cpp index 4df82349c..ed5951c26 100644 --- a/mobile-widgets/qmlmanager.cpp +++ b/mobile-widgets/qmlmanager.cpp @@ -108,13 +108,13 @@ void QMLManager::applicationStateChanged(Qt::ApplicationState state) case Qt::ApplicationInactive: stateText = "inactive"; break; default: stateText = QString("none of the four: 0x") + QString::number(state, 16); } - stateText.prepend(QString::number(timer.elapsed() / 1000.0,'f', 3) + ": AppState changed to "); + stateText.prepend("AppState changed to "); stateText.append(" with "); stateText.append((alreadySaving ? QLatin1Literal("") : QLatin1Literal("no ")) + QLatin1Literal("save ongoing")); stateText.append(" and "); stateText.append((unsaved_changes() ? QLatin1Literal("") : QLatin1Literal("no ")) + QLatin1Literal("unsaved changes")); appendTextToLog(stateText); - qDebug() << stateText; + qDebug() << QString::number(timer.elapsed() / 1000.0,'f', 3) << ":" << stateText; if (!alreadySaving && state == Qt::ApplicationInactive && unsaved_changes()) { // FIXME @@ -990,7 +990,9 @@ void QMLManager::setLogText(const QString &logText) void QMLManager::appendTextToLog(const QString &newText) { - m_logText += "\n" + newText; + if (!timer.isValid()) + timer.start(); + m_logText += "\n" + QString::number(timer.elapsed() / 1000.0,'f', 3) + ": " + newText; emit logTextChanged(); } |