diff options
author | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-02 09:51:04 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@theqtcompany.com> | 2015-07-02 08:23:28 +0000 |
commit | 33f6e267ad2fc4aeb50a5a91bc55279536608a8c (patch) | |
tree | 3c8244b6363e58d53f2c24e3c272f0d965397614 | |
parent | 9d0e702b1f29c8120f2000e1558a7b040311d8c0 (diff) |
Use QQmlDebuggingEnabler::StartMode in connectToLocalDebugger
This unifies the API and gets rid of an ambiguous bool parameter.
Change-Id: If9d8906f9cd366cf37bd1bdded7fbd6c62146e32
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
-rw-r--r-- | src/qml/debugger/qqmldebug.h | 3 | ||||
-rw-r--r-- | src/qml/debugger/qqmldebugserver.cpp | 13 |
2 files changed, 9 insertions, 7 deletions
diff --git a/src/qml/debugger/qqmldebug.h b/src/qml/debugger/qqmldebug.h index 58afa004a0..5d65982a49 100644 --- a/src/qml/debugger/qqmldebug.h +++ b/src/qml/debugger/qqmldebug.h @@ -50,7 +50,8 @@ struct Q_QML_EXPORT QQmlDebuggingEnabler QQmlDebuggingEnabler(bool printWarning = true); static bool startTcpDebugServer(int port, StartMode mode = DoNotWaitForClient, const QString &hostName = QString()); - static bool connectToLocalDebugger(const QString &socketFileName, bool block = false); + static bool connectToLocalDebugger(const QString &socketFileName, + StartMode mode = DoNotWaitForClient); }; // Execute code in constructor before first QQmlEngine is instantiated diff --git a/src/qml/debugger/qqmldebugserver.cpp b/src/qml/debugger/qqmldebugserver.cpp index 0e6a182b1a..020d0ad52d 100644 --- a/src/qml/debugger/qqmldebugserver.cpp +++ b/src/qml/debugger/qqmldebugserver.cpp @@ -869,15 +869,16 @@ bool QQmlDebuggingEnabler::startTcpDebugServer(int port, StartMode mode, const Q /*! * Enables debugging for QML engines created after calling this function. The debug server will * connect to a debugger waiting on a local socket at the given \a socketFileName and block the QML - * engine until the connection is established if \a block is true. If \a block is not specified it - * won't block. You can only start one debug server at a time. A debug server may have already been - * started if the -qmljsdebugger= command line argument was given. This method returns \c true if a - * new debug server was successfully started, or \c false otherwise. + * engine until the connection is established if \a mode is \c WaitForClient. If \a mode is not + * specified it will not block. You can only start one debug server at a time. A debug server may + * have already been started if the -qmljsdebugger= command line argument was given. This method + * returns \c true if a new debug server was successfully started, or \c false otherwise. */ -bool QQmlDebuggingEnabler::connectToLocalDebugger(const QString &socketFileName, bool block) +bool QQmlDebuggingEnabler::connectToLocalDebugger(const QString &socketFileName, StartMode mode) { #ifndef QQML_NO_DEBUG_PROTOCOL - return QQmlDebugServerPrivate::enable(ConnectToLocalAction(socketFileName, block)); + return QQmlDebugServerPrivate::enable(ConnectToLocalAction(socketFileName, + mode == WaitForClient)); #else Q_UNUSED(fileName); Q_UNUSED(block); |