From c975f80db197cef667c512c06e3a03b17570e7d6 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Wed, 14 Mar 2012 14:20:31 +0100 Subject: QmlProfiler: Make sure there's minimal overhead when not enabled Do expensive operations directly in the constructor, guarded by and if (enabled). Also assert if the methods where this isn't feasible are called altough debugging hasn't been enabled. Change-Id: Ieaa3c71730042a88af2270203ea747af42ba5c58 Reviewed-by: Aaron Kennedy --- src/qml/qml/qqmlboundsignal.cpp | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'src/qml/qml/qqmlboundsignal.cpp') diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp index ca6b13e7f8..3200aaea3a 100644 --- a/src/qml/qml/qqmlboundsignal.cpp +++ b/src/qml/qml/qqmlboundsignal.cpp @@ -174,13 +174,7 @@ int QQmlBoundSignal::qt_metacall(QMetaObject::Call c, int id, void **a) if (QQmlDebugService::isDebuggingEnabled()) QV8DebugService::instance()->signalEmitted(QString::fromAscii(m_signal.signature())); - QQmlHandlingSignalProfiler prof; - if (prof.enabled) { - prof.setSignalInfo(QString::fromLatin1(m_signal.signature()), - m_expression->expression()); - prof.setLocation(m_expression->sourceFile(), m_expression->lineNumber(), - m_expression->columnNumber()); - } + QQmlHandlingSignalProfiler prof(m_signal, m_expression); m_isEvaluating = true; if (!m_paramsValid) { -- cgit v1.2.3