QmlProfiler: printing current profiler state in error message

For debug purposes, facilitates troubleshooting when bugs are spotted.

Change-Id: I6f76d251bc4855f1d1f0ccf4724cd342c39cad29
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Christiaan Janssen
2012-05-09 10:49:02 +02:00
committed by Kai Koehne
parent ba9c802e1e
commit 5692c68154

View File

@@ -111,29 +111,37 @@ void QmlProfilerStateManager::setCurrentState(QmlProfilerState newState)
case Idle:
QTC_ASSERT(d->m_currentState == AppStarting ||
d->m_currentState == AppStopped ||
d->m_currentState == AppKilled, /**/);
d->m_currentState == AppKilled,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppStarting:
QTC_ASSERT(d->m_currentState == Idle, /**/);
QTC_ASSERT(d->m_currentState == Idle,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppRunning:
QTC_ASSERT(d->m_currentState == AppStarting, /**/);
QTC_ASSERT(d->m_currentState == AppStarting,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppStopRequested:
QTC_ASSERT(d->m_currentState == AppRunning, /**/);
QTC_ASSERT(d->m_currentState == AppRunning,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppReadyToStop:
QTC_ASSERT(d->m_currentState == AppStopRequested, /**/);
QTC_ASSERT(d->m_currentState == AppStopRequested,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppStopped:
QTC_ASSERT(d->m_currentState == AppReadyToStop ||
d->m_currentState == AppDying, /**/);
d->m_currentState == AppDying,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppDying:
QTC_ASSERT(d->m_currentState == AppRunning, /**/);
QTC_ASSERT(d->m_currentState == AppRunning,
qDebug() << "from" << stringForState(d->m_currentState));
break;
case AppKilled:
QTC_ASSERT(d->m_currentState == AppDying, /**/);
QTC_ASSERT(d->m_currentState == AppDying,
qDebug() << "from" << stringForState(d->m_currentState));
default:
qDebug() << tr("Switching to unknown state in %1:%2").arg(QString(__FILE__), QString::number(__LINE__));
break;