diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-09-27 18:23:53 +0200 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-10-16 14:04:24 +0000 |
commit | d386b4ed6df48f19e8b1c2b1b5044ff847c59699 (patch) | |
tree | 665d07f8ed53e97093af3cf78517f73c1cb315a0 /src/plugins/qmlprofiler/qmlprofilerclientmanager.h | |
parent | a54685aa59e48fc993c1d3531d6abd9c70ca3a56 (diff) |
QmlDebug: Extract a general QML debug connection manager from QmlProfiler
We can use it for other QmlDebug run controls, too.
Change-Id: Iee1cd592848ef4c48954a2674b6fa509223fcda4
Reviewed-by: hjk <hjk@qt.io>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerclientmanager.h')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerclientmanager.h | 53 |
1 files changed, 9 insertions, 44 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h index c64429abc7..8f3c8f668b 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.h +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.h @@ -28,6 +28,7 @@ #include "qmlprofilertraceclient.h" #include <qmldebug/qmldebugclient.h> +#include <qmldebug/qmldebugconnectionmanager.h> #include <QPointer> #include <QTimer> @@ -39,63 +40,27 @@ class QmlProfilerStateManager; namespace Internal { -class QmlProfilerClientManager : public QObject +class QmlProfilerClientManager : public QmlDebug::QmlDebugConnectionManager { Q_OBJECT public: explicit QmlProfilerClientManager(QObject *parent = 0); - ~QmlProfilerClientManager(); - void setProfilerStateManager(QmlProfilerStateManager *profilerState); - void connectToServer(const QUrl &server); - void clearConnection(); - - void clearBufferedData(); - bool isConnected() const; - - void setModelManager(QmlProfilerModelManager *m); + void setModelManager(QmlProfilerModelManager *modelManager); void setFlushInterval(quint32 flushInterval); - - void setRetryParams(int interval, int maxAttempts); - void retryConnect(); - + void clearBufferedData(); void stopRecording(); -signals: - void connectionOpened(); - void connectionFailed(); - void connectionClosed(); +protected: + void createClients() override; + void destroyClients() override; + void logState(const QString &message) override; private: - void connectToTcpServer(); - void startLocalServer(); - + QPointer<QmlProfilerTraceClient> m_clientPlugin; QPointer<QmlProfilerStateManager> m_profilerState; QPointer<QmlProfilerModelManager> m_modelManager; - QScopedPointer<QmlDebug::QmlDebugConnection> m_connection; - QScopedPointer<QmlProfilerTraceClient> m_qmlclientplugin; - - QTimer m_connectionTimer; - - QUrl m_server; quint32 m_flushInterval = 0; - - int m_retryInterval = 200; - int m_maximumRetries = 50; - int m_numRetries = 0; - - void disconnectClient(); - void stopConnectionTimer(); - - void qmlDebugConnectionOpened(); - void qmlDebugConnectionClosed(); - void qmlDebugConnectionFailed(); - - void logState(const QString &); - - void createConnection(); - void connectClientSignals(); - void disconnectClientSignals(); }; } // namespace Internal |