aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/debugger/qqmlconfigurabledebugservice.cpp4
-rw-r--r--src/qml/debugger/qqmldebugservice.cpp17
-rw-r--r--src/qml/debugger/qqmldebugservice_p.h4
-rw-r--r--src/qml/qml/qqmlboundsignal.cpp3
-rw-r--r--src/qml/qml/qqmlengine.cpp3
-rw-r--r--src/qml/qml/v8/qqmlbuiltinfunctions.cpp5
-rw-r--r--src/quick/items/qquickview.cpp5
-rw-r--r--src/quick/qtquick2.cpp3
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp3
-rw-r--r--src/quickwidgets/qquickwidget.cpp5
-rw-r--r--tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp4
-rw-r--r--tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp4
-rw-r--r--tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp5
-rw-r--r--tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp3
14 files changed, 30 insertions, 38 deletions
diff --git a/src/qml/debugger/qqmlconfigurabledebugservice.cpp b/src/qml/debugger/qqmlconfigurabledebugservice.cpp
index c63910efc5..808a0f104f 100644
--- a/src/qml/debugger/qqmlconfigurabledebugservice.cpp
+++ b/src/qml/debugger/qqmlconfigurabledebugservice.cpp
@@ -33,6 +33,7 @@
#include "qqmlconfigurabledebugservice_p.h"
#include "qqmlconfigurabledebugservice_p_p.h"
+#include "qqmldebugserver_p.h"
QT_BEGIN_NAMESPACE
@@ -55,7 +56,8 @@ void QQmlConfigurableDebugService::init()
Q_D(QQmlConfigurableDebugService);
QMutexLocker lock(&d->configMutex);
// If we're not enabled or not blocking, don't wait for configuration
- d->waitingForConfiguration = (registerService() == Enabled && blockingMode());
+ d->waitingForConfiguration = (registerService() == Enabled &&
+ QQmlDebugServer::instance()->blockingMode());
}
void QQmlConfigurableDebugService::stopWaiting()
diff --git a/src/qml/debugger/qqmldebugservice.cpp b/src/qml/debugger/qqmldebugservice.cpp
index da9300477b..c70ea10175 100644
--- a/src/qml/debugger/qqmldebugservice.cpp
+++ b/src/qml/debugger/qqmldebugservice.cpp
@@ -159,23 +159,6 @@ const QHash<int, QObject *> &QQmlDebugService::objectsForIds()
return objectReferenceHash()->ids;
}
-bool QQmlDebugService::isDebuggingEnabled()
-{
- return QQmlDebugServer::instance() != 0;
-}
-
-bool QQmlDebugService::hasDebuggingClient()
-{
- return QQmlDebugServer::instance() != 0
- && QQmlDebugServer::instance()->hasDebuggingClient();
-}
-
-bool QQmlDebugService::blockingMode()
-{
- return QQmlDebugServer::instance() != 0
- && QQmlDebugServer::instance()->blockingMode();
-}
-
QString QQmlDebugService::objectToString(QObject *obj)
{
if(!obj)
diff --git a/src/qml/debugger/qqmldebugservice_p.h b/src/qml/debugger/qqmldebugservice_p.h
index 3574f68b7f..f25bb48e05 100644
--- a/src/qml/debugger/qqmldebugservice_p.h
+++ b/src/qml/debugger/qqmldebugservice_p.h
@@ -80,10 +80,6 @@ public:
static QString objectToString(QObject *obj);
- static bool isDebuggingEnabled();
- static bool hasDebuggingClient();
- static bool blockingMode();
-
protected:
explicit QQmlDebugService(const QString &, float version, QObject *parent = 0);
QQmlDebugService(QQmlDebugServicePrivate &dd, QObject *parent = 0);
diff --git a/src/qml/qml/qqmlboundsignal.cpp b/src/qml/qml/qqmlboundsignal.cpp
index 8b6f8afdce..3d263590e8 100644
--- a/src/qml/qml/qqmlboundsignal.cpp
+++ b/src/qml/qml/qqmlboundsignal.cpp
@@ -44,6 +44,7 @@
#include "qqmlglobal_p.h"
#include <private/qqmlprofiler_p.h>
#include <private/qv4debugservice_p.h>
+#include <private/qqmldebugserver_p.h>
#include <private/qqmlcompiler_p.h>
#include "qqmlinfo.h"
@@ -319,7 +320,7 @@ void QQmlBoundSignal_callback(QQmlNotifierEndpoint *e, void **a)
if (!s->m_expression)
return;
- if (QQmlDebugService::isDebuggingEnabled())
+ if (QQmlDebugServer::instance())
QV4DebugService::instance()->signalEmitted(QString::fromLatin1(QMetaObjectPrivate::signal(s->m_expression->target()->metaObject(), s->signalIndex()).methodSignature()));
QQmlEngine *engine;
diff --git a/src/qml/qml/qqmlengine.cpp b/src/qml/qml/qqmlengine.cpp
index fdce590873..ea9e257824 100644
--- a/src/qml/qml/qqmlengine.cpp
+++ b/src/qml/qml/qqmlengine.cpp
@@ -861,8 +861,7 @@ void QQmlEnginePrivate::init()
rootContext = new QQmlContext(q,true);
- if (QCoreApplication::instance()->thread() == q->thread() &&
- QQmlEngineDebugService::isDebuggingEnabled()) {
+ if (QCoreApplication::instance()->thread() == q->thread() && QQmlDebugServer::instance()) {
isDebugging = true;
QQmlEngineDebugService::instance();
QV4DebugService::instance();
diff --git a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
index aff6de7f5e..26dd104753 100644
--- a/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
+++ b/src/qml/qml/v8/qqmlbuiltinfunctions.cpp
@@ -42,6 +42,7 @@
#include <QFileInfo>
#include <private/qqmlprofilerservice_p.h>
+#include <private/qqmldebugserver_p.h>
#include <private/qqmlglobal_p.h>
#include <private/qqmlplatform_p.h>
@@ -1447,7 +1448,7 @@ 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 (!QQmlDebugService::isDebuggingEnabled()) {
+ if (!QQmlDebugServer::instance()) {
logger.warning("Cannot start profiling because debug service is disabled. Start with -qmljsdebugger=port:XXXXX.");
} else {
QQmlProfilerService::instance()->startProfiling(v4->qmlEngine());
@@ -1466,7 +1467,7 @@ QV4::ReturnedValue ConsoleObject::method_profileEnd(CallContext *ctx)
const QByteArray baFunction = frame.function.toUtf8();
QMessageLogger logger(baSource.constData(), frame.line, baFunction.constData());
- if (!QQmlDebugService::isDebuggingEnabled()) {
+ if (!QQmlDebugServer::instance()) {
logger.warning("Ignoring console.profileEnd(): the debug service is disabled.");
} else {
QQmlProfilerService::instance()->stopProfiling(v4->qmlEngine());
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index 6582e3ad40..90046fb013 100644
--- a/src/quick/items/qquickview.cpp
+++ b/src/quick/items/qquickview.cpp
@@ -38,6 +38,7 @@
#include "qquickitem_p.h"
#include "qquickitemchangelistener_p.h"
+#include <private/qqmldebugserver_p.h>
#include <private/qquickprofiler_p.h>
#include <private/qqmlinspectorservice_p.h>
#include <private/qqmlmemoryprofiler_p.h>
@@ -86,7 +87,7 @@ void QQuickViewPrivate::init(QQmlEngine* e)
rootItemMarker.set(v4, v);
}
- if (QQmlDebugService::isDebuggingEnabled())
+ if (QQmlDebugServer::instance())
QQmlInspectorService::instance()->addView(q);
}
@@ -97,7 +98,7 @@ QQuickViewPrivate::QQuickViewPrivate()
QQuickViewPrivate::~QQuickViewPrivate()
{
- if (QQmlDebugService::isDebuggingEnabled())
+ if (QQmlDebugServer::instance())
QQmlInspectorService::instance()->removeView(q_func());
}
diff --git a/src/quick/qtquick2.cpp b/src/quick/qtquick2.cpp
index 6027a6ddc1..e4937e2bf6 100644
--- a/src/quick/qtquick2.cpp
+++ b/src/quick/qtquick2.cpp
@@ -39,6 +39,7 @@
#include <private/qquickaccessiblefactory_p.h>
#include <private/qqmlenginedebugservice_p.h>
+#include <private/qqmldebugserver_p.h>
#include <private/qqmldebugstatesdelegate_p.h>
#include <private/qqmlbinding_p.h>
#include <private/qqmlcontext_p.h>
@@ -186,7 +187,7 @@ void QQmlQtQuick2Module::defineModule()
QAccessible::installFactory(&qQuickAccessibleFactory);
#endif
- if (QQmlDebugService::isDebuggingEnabled()) {
+ if (QQmlDebugServer::instance()) {
QQmlEngineDebugService::instance()->setStatesDelegate(
new QQmlQtQuick2DebugStatesDelegate);
QQuickProfiler::initialize();
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 3b8fdebeed..d43b15e1d3 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -55,6 +55,7 @@
#include <private/qquickprofiler_p.h>
#include <private/qqmldebugservice_p.h>
+#include <private/qqmldebugserver_p.h>
#include <private/qquickshadereffectnode_p.h>
@@ -688,7 +689,7 @@ void QSGRenderThread::run()
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "run()";
animatorDriver = sgrc->sceneGraphContext()->createAnimationDriver(0);
animatorDriver->install();
- if (QQmlDebugService::isDebuggingEnabled())
+ if (QQmlDebugServer::instance())
QQuickProfiler::registerAnimationCallback();
while (active) {
diff --git a/src/quickwidgets/qquickwidget.cpp b/src/quickwidgets/qquickwidget.cpp
index 955abfddb2..96fd262bfc 100644
--- a/src/quickwidgets/qquickwidget.cpp
+++ b/src/quickwidgets/qquickwidget.cpp
@@ -39,6 +39,7 @@
#include "private/qquickitemchangelistener_p.h"
#include "private/qquickrendercontrol_p.h"
+#include <private/qqmldebugserver_p.h>
#include <private/qquickprofiler_p.h>
#include <private/qqmlinspectorservice_p.h>
#include <private/qqmlmemoryprofiler_p.h>
@@ -95,7 +96,7 @@ void QQuickWidgetPrivate::init(QQmlEngine* e)
if (!engine.data()->incubationController())
engine.data()->setIncubationController(offscreenWindow->incubationController());
- if (QQmlDebugService::isDebuggingEnabled())
+ if (QQmlDebugServer::instance())
QQmlInspectorService::instance()->addView(q);
#ifndef QT_NO_DRAGANDDROP
@@ -147,7 +148,7 @@ QQuickWidgetPrivate::QQuickWidgetPrivate()
QQuickWidgetPrivate::~QQuickWidgetPrivate()
{
- if (QQmlDebugService::isDebuggingEnabled())
+ if (QQmlDebugServer::instance())
QQmlInspectorService::instance()->removeView(q_func());
invalidateRenderControl();
diff --git a/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp b/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp
index d2ae863433..3aaf833f5b 100644
--- a/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp
+++ b/tests/auto/qml/debugger/qqmldebugclient/tst_qqmldebugclient.cpp
@@ -39,6 +39,8 @@
#include <QtQml/qqmlengine.h>
+#include <private/qqmldebugserver_p.h>
+
#include "debugutil_p.h"
#include "qqmldebugtestservice.h"
@@ -82,7 +84,7 @@ void tst_QQmlDebugClient::initTestCase()
QVERIFY(m_conn->isConnected());
- QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
+ QTRY_VERIFY(QQmlDebugServer::instance() && QQmlDebugServer::instance()->hasDebuggingClient());
QTRY_COMPARE(client.state(), QQmlDebugClient::Enabled);
}
diff --git a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp
index cef2f1cecd..f2cb141a6c 100644
--- a/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp
+++ b/tests/auto/qml/debugger/qqmldebuglocal/tst_qqmldebuglocal.cpp
@@ -39,6 +39,8 @@
#include <QThread>
#include <ctime>
+#include <private/qqmldebugserver_p.h>
+
#include "debugutil_p.h"
#include "qqmldebugtestservice.h"
@@ -86,7 +88,7 @@ void tst_QQmlDebugLocal::initTestCase()
QVERIFY(m_conn->isConnected());
- QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
+ QTRY_VERIFY(QQmlDebugServer::instance() && QQmlDebugServer::instance()->hasDebuggingClient());
QTRY_COMPARE(client.state(), QQmlDebugClient::Enabled);
}
diff --git a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
index bb8b8f0823..da320ebefa 100644
--- a/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmldebugservice/tst_qqmldebugservice.cpp
@@ -39,6 +39,7 @@
#include <QLibraryInfo>
#include <QtQml/qqmlengine.h>
+#include <private/qqmldebugserver_p.h>
#include "../../../shared/util.h"
#include "debugutil_p.h"
@@ -88,7 +89,7 @@ void tst_QQmlDebugService::initTestCase()
}
QVERIFY(m_conn->isConnected());
- QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
+ QTRY_VERIFY(QQmlDebugServer::instance() && QQmlDebugServer::instance()->hasDebuggingClient());
}
void tst_QQmlDebugService::checkPortRange()
@@ -258,7 +259,7 @@ void tst_QQmlDebugService::checkSupportForOldDataStreamVersion()
}
QVERIFY(m_conn->isConnected());
- QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
+ QTRY_VERIFY(QQmlDebugServer::instance() && QQmlDebugServer::instance()->hasDebuggingClient());
QQmlDebugTestService service("tst_QQmlDebugService::sendMessage2()");
QQmlDebugTestClient client("tst_QQmlDebugService::sendMessage2()", m_conn);
diff --git a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
index 0b766bc500..2722ef984b 100644
--- a/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
+++ b/tests/auto/qml/debugger/qqmlenginedebugservice/tst_qqmlenginedebugservice.cpp
@@ -48,6 +48,7 @@
#include <private/qqmlbinding_p.h>
#include <private/qqmlboundsignal_p.h>
#include <private/qqmldebugservice_p.h>
+#include <private/qqmldebugserver_p.h>
#include <private/qqmlmetatype_p.h>
#include <private/qqmlproperty_p.h>
@@ -351,7 +352,7 @@ void tst_QQmlEngineDebugService::initTestCase()
bool ok = m_conn->waitForConnected();
QVERIFY(ok);
- QTRY_VERIFY(QQmlDebugService::hasDebuggingClient());
+ QTRY_VERIFY(QQmlDebugServer::instance() && QQmlDebugServer::instance()->hasDebuggingClient());
m_dbg = new QQmlEngineDebugClient(m_conn);
QTRY_COMPARE(m_dbg->state(), QQmlEngineDebugClient::Enabled);
}