qtcassert: move actual printing to separate function and enforce style

This also allows simple setting of breakpoints on failed asserts.

Change-Id: I6dd84cbfaf659d57e39f3447386cebc0221b2b84
Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
hjk
2012-04-17 08:01:25 +02:00
committed by hjk
parent 37e3853090
commit 5b0bf61640
95 changed files with 347 additions and 297 deletions

View File

@@ -94,14 +94,13 @@ QString toOptionString(CallgrindController::Option option)
}
}
void CallgrindController::run(Option option)
{
if (m_process) {
emit statusMessage(tr("Previous command has not yet finished."));
return;
}
QTC_ASSERT(m_valgrindProc, return)
QTC_ASSERT(m_valgrindProc, return);
if (RemoteValgrindProcess *remote = qobject_cast<RemoteValgrindProcess *>(m_valgrindProc))
m_process = new RemoteValgrindProcess(remote->connection(), this);
@@ -150,7 +149,7 @@ void CallgrindController::run(Option option)
void CallgrindController::processError(QProcess::ProcessError)
{
QTC_ASSERT(m_process, return)
QTC_ASSERT(m_process, return);
const QString error = m_process->errorString();
emit statusMessage(QString("An error occurred while trying to run %1: %2").arg(CALLGRIND_CONTROL_BINARY).arg(error));