From 08db29d5b89e05657ac19022f1ff32275201df78 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Mon, 27 Jan 2014 16:05:49 +0100 Subject: Make sure a profiling range is started for every handled signal If we allow an endRange() without a startRange() before the range nesting can get confused. Also, it's enough to check the existence of the profiler once. Change-Id: I255675d6e23505b6f29196c0470892f6d778e7b4 Reviewed-by: Simon Hausmann --- src/qml/debugger/qqmlprofilerservice_p.h | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/qml/debugger/qqmlprofilerservice_p.h') diff --git a/src/qml/debugger/qqmlprofilerservice_p.h b/src/qml/debugger/qqmlprofilerservice_p.h index c3329dbb89..ccee42937d 100644 --- a/src/qml/debugger/qqmlprofilerservice_p.h +++ b/src/qml/debugger/qqmlprofilerservice_p.h @@ -402,20 +402,19 @@ struct QQmlBindingProfiler { struct QQmlHandlingSignalProfiler { QQmlHandlingSignalProfiler(QQmlBoundSignalExpression *expression) { - if (QQmlProfilerService::enabled) { - if (expression->sourceFile().isEmpty()) { - QV4::Function *function = expression->function(); - if (function) { - Q_QML_PROFILE(startHandlingSignal( - function->sourceFile(), function->compiledFunction->location.line, - function->compiledFunction->location.column)); - } + Q_QML_PROFILE_IF_ENABLED({ + QV4::Function *function; + if (expression->sourceFile().isEmpty() && (function = expression->function())) { + QQmlProfilerService::startHandlingSignal( + function->sourceFile(), function->compiledFunction->location.line, + function->compiledFunction->location.column); + } else { - Q_QML_PROFILE(startHandlingSignal( + QQmlProfilerService::startHandlingSignal( expression->sourceFile(), expression->lineNumber(), - expression->columnNumber())); + expression->columnNumber()); } - } + }); } ~QQmlHandlingSignalProfiler() -- cgit v1.2.3