diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-14 15:32:33 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-08-04 13:34:29 +0000 |
commit | e115fca4af33bee94c5d524e5d7776b1fa6a31a7 (patch) | |
tree | 016fb9d57e1137957272db71f978e201440c7318 /src/qml/qml/v8/qqmlbuiltinfunctions.cpp | |
parent | 2c0ed9491e55bdc96bc2deb5ec3c40df6e3271f6 (diff) |
Retrieve services from debug connector, not via static instance()
This will allow us to remove the instance() methods and create the
services from factories in plugins. Also, it allows us to remove the
isDebugging member from QQmlEnginePrivate.
Change-Id: Id9d9820a910902ecfdb1e8175e215093ce3d0965
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml/qml/v8/qqmlbuiltinfunctions.cpp')
-rw-r--r-- | src/qml/qml/v8/qqmlbuiltinfunctions.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp index 4f750bb31b..c0e3b4129b 100644 --- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp +++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp @@ -41,8 +41,8 @@ #include <private/qv8engine_p.h> #include <QFileInfo> -#include <private/qqmlprofilerservice_p.h> #include <private/qqmldebugconnector_p.h> +#include <private/qqmldebugserviceinterfaces_p.h> #include <private/qqmlglobal_p.h> #include <private/qqmlplatform_p.h> @@ -1448,10 +1448,11 @@ 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 (!QQmlDebugConnector::instance()) { + QQmlProfilerService *service = QQmlDebugConnector::service<QQmlProfilerService>(); + if (!service) { logger.warning("Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX."); } else { - QQmlProfilerServiceImpl::instance()->startProfiling(v4->qmlEngine()); + service->startProfiling(v4->qmlEngine()); logger.debug("Profiling started."); } @@ -1467,10 +1468,11 @@ QV4::ReturnedValue ConsoleObject::method_profileEnd(CallContext *ctx) const QByteArray baFunction = frame.function.toUtf8(); QMessageLogger logger(baSource.constData(), frame.line, baFunction.constData()); - if (!QQmlDebugConnector::instance()) { + QQmlProfilerService *service = QQmlDebugConnector::service<QQmlProfilerService>(); + if (!service) { logger.warning("Ignoring console.profileEnd(): the debug service is disabled."); } else { - QQmlProfilerServiceImpl::instance()->stopProfiling(v4->qmlEngine()); + service->stopProfiling(v4->qmlEngine()); logger.debug("Profiling ended."); } |