mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 00:43:24 +00:00
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>
This commit is contained in:
parent
9607ff6c93
commit
fe62da3a6b
1 changed files with 5 additions and 3 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue