aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-13 16:13:00 +0200
committerUlf Hermann <ulf.hermann@theqtcompany.com>2015-07-29 14:35:54 +0000
commitdb90054b186317da4e363c64207c0156d9d73da5 (patch)
tree3c9c7fd5d58ace0bb5e03e7fb67dae8661e08902 /src/qml
parent3f3de3b9b762ecc2799a3575b97a2b172fcbc79a (diff)
Remove static proxy methods from QQmlDebugService
They all internally map to one-liners and just add to binary size and complexity. Especially, the most used one, isDebuggingEnabled(), simply checks if there is a QQmlDebugServer::instance(). Change-Id: Ib269928e08506894d933f6696e34ff0d3acb048b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/qml')
-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
6 files changed, 9 insertions, 27 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());