diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/qml/debugger/qqmlprofilerservice.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qml/debugger/qqmlprofilerservice.cpp b/src/qml/debugger/qqmlprofilerservice.cpp index 3c066bd380..af2aea21ae 100644 --- a/src/qml/debugger/qqmlprofilerservice.cpp +++ b/src/qml/debugger/qqmlprofilerservice.cpp @@ -178,7 +178,7 @@ void QQmlProfilerService::sendProfilingData() bool QQmlProfilerService::startProfilingImpl() { bool success = false; - if (!profilingEnabled()) { + if (QQmlDebugService::isDebuggingEnabled() && !profilingEnabled()) { setProfilingEnabled(true); sendStartedProfilingMessageImpl(); success = true; diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 0409b92e89..67b7e789bd 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -1432,7 +1432,9 @@ QV4::ReturnedValue ConsoleObject::method_profile(CallContext *ctx) const QByteArray baSource = frame.source.toUtf8(); const QByteArray baFunction = frame.function.toUtf8(); QMessageLogger logger(baSource.constData(), frame.line, baFunction.constData()); - if (QQmlProfilerService::startProfiling()) { + if (!QQmlDebugService::isDebuggingEnabled()) { + logger.warning("Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX."); + } else if (QQmlProfilerService::startProfiling()) { QV8ProfilerService::instance()->startProfiling(title); logger.debug("Profiling started."); |