diff options
author | Christiaan Janssen <[email protected]> | 2013-08-08 13:28:08 +0200 |
---|---|---|
committer | Christiaan Janssen <[email protected]> | 2013-08-09 17:19:32 +0200 |
commit | 0a3b20f5f99bec75b590aa81ae26aac046efd794 (patch) | |
tree | 13cdc00fe9b5a3e5c91cba19950ff4d788ee42f8 /src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | |
parent | 7764f35107e901e74458847315ffd114199ce26c (diff) |
QmlProfiler: reworked
Change-Id: I66a236a024d76e7bef6edfb91ae30b5dd098b76b
Reviewed-by: Kai Koehne <[email protected]>
Diffstat (limited to 'src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp')
-rw-r--r-- | src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp | 66 |
1 files changed, 44 insertions, 22 deletions
diff --git a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp index 5d517e503cb..926a382ce74 100644 --- a/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp +++ b/src/plugins/qmlprofiler/qmlprofilerclientmanager.cpp @@ -40,16 +40,19 @@ #include <QTimer> #include <QMessageBox> +#include "qmlprofilermodelmanager.h" + using namespace QmlDebug; using namespace Core; namespace QmlProfiler { namespace Internal { -class QmlProfilerClientManager::QmlProfilerClientManagerPrivate -{ +class QmlProfilerClientManager::QmlProfilerClientManagerPrivate { public: - QmlProfilerStateManager *profilerState; + QmlProfilerClientManagerPrivate(QmlProfilerClientManager *qq) { Q_UNUSED(qq); } + + QmlProfilerStateManager* profilerState; QmlDebugConnection *connection; QPointer<QmlProfilerTraceClient> qmlclientplugin; @@ -58,7 +61,9 @@ public: QTimer connectionTimer; int connectionAttempts; - enum ConnectMode { TcpConnection, OstConnection }; + enum ConnectMode { + TcpConnection, OstConnection + }; ConnectMode connectMode; QString tcpHost; quint64 tcpPort; @@ -67,10 +72,12 @@ public: bool v8DataReady; bool qmlDataReady; + + QmlProfilerModelManager *modelManager; }; QmlProfilerClientManager::QmlProfilerClientManager(QObject *parent) : - QObject(parent), d(new QmlProfilerClientManagerPrivate) + QObject(parent), d(new QmlProfilerClientManagerPrivate(this)) { setObjectName(QLatin1String("QML Profiler Connections")); @@ -81,6 +88,8 @@ QmlProfilerClientManager::QmlProfilerClientManager(QObject *parent) : d->v8DataReady = false; d->qmlDataReady = false; + d->modelManager = 0; + d->connectionTimer.setInterval(200); connect(&d->connectionTimer, SIGNAL(timeout()), SLOT(tryToConnect())); } @@ -95,6 +104,17 @@ QmlProfilerClientManager::~QmlProfilerClientManager() delete d; } +void QmlProfilerClientManager::setModelManager(QmlProfilerModelManager *m) +{ + if (d->modelManager) { + disconnect(this,SIGNAL(dataReadyForProcessing()), d->modelManager, SLOT(complete())); + } + d->modelManager = m; + if (d->modelManager) { + connect(this,SIGNAL(dataReadyForProcessing()), d->modelManager, SLOT(complete())); + } +} + //////////////////////////////////////////////////////////////// // Interface void QmlProfilerClientManager::setTcpConnection(QString host, quint64 port) @@ -159,15 +179,15 @@ void QmlProfilerClientManager::connectClientSignals() connect(d->qmlclientplugin.data(), SIGNAL(complete()), this, SLOT(qmlComplete())); connect(d->qmlclientplugin.data(), - SIGNAL(range(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)), - this, - SIGNAL(addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation))); + SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation, + qint64,qint64,qint64,qint64,qint64)), + d->modelManager, + SLOT(addQmlEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation, + qint64,qint64,qint64,qint64,qint64))); connect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)), - this, SIGNAL(traceFinished(qint64))); + d->modelManager->traceTime(), SLOT(setEndTime(qint64))); connect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64)), - this, SIGNAL(traceStarted(qint64))); - connect(d->qmlclientplugin.data(), SIGNAL(frame(qint64,int,int)), - this, SIGNAL(addFrameEvent(qint64,int,int))); + d->modelManager->traceTime(), SLOT(setStartTime(qint64))); connect(d->qmlclientplugin.data(), SIGNAL(enabledChanged()), d->qmlclientplugin.data(), SLOT(sendRecordingStatus())); // fixme: this should be unified for both clients @@ -178,8 +198,8 @@ void QmlProfilerClientManager::connectClientSignals() connect(d->v8clientplugin.data(), SIGNAL(complete()), this, SLOT(v8Complete())); connect(d->v8clientplugin.data(), SIGNAL(v8range(int,QString,QString,int,double,double)), - this, - SIGNAL(addV8Event(int,QString,QString,int,double,double))); + d->modelManager, + SLOT(addV8Event(int,QString,QString,int,double,double))); connect(d->v8clientplugin.data(), SIGNAL(enabledChanged()), d->v8clientplugin.data(), SLOT(sendRecordingStatus())); } @@ -191,15 +211,17 @@ void QmlProfilerClientManager::disconnectClientSignals() disconnect(d->qmlclientplugin.data(), SIGNAL(complete()), this, SLOT(qmlComplete())); disconnect(d->qmlclientplugin.data(), - SIGNAL(range(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation)), - this, - SIGNAL(addRangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation))); + SIGNAL(rangedEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation, + qint64,qint64,qint64,qint64,qint64)), + d->modelManager, + SLOT(addQmlEvent(int,int,qint64,qint64,QStringList,QmlDebug::QmlEventLocation, + qint64,qint64,qint64,qint64,qint64))); disconnect(d->qmlclientplugin.data(), SIGNAL(traceFinished(qint64)), - this, SIGNAL(traceFinished(qint64))); + d->modelManager->traceTime(), SLOT(setEndTime(qint64))); disconnect(d->qmlclientplugin.data(), SIGNAL(traceStarted(qint64)), - this, SIGNAL(traceStarted(qint64))); + d->modelManager->traceTime(), SLOT(setStartTime(qint64))); disconnect(d->qmlclientplugin.data(), SIGNAL(frame(qint64,int,int)), - this, SIGNAL(addFrameEvent(qint64,int,int))); + d->modelManager, SLOT(addFrameEvent(qint64,int,int))); disconnect(d->qmlclientplugin.data(), SIGNAL(enabledChanged()), d->qmlclientplugin.data(), SLOT(sendRecordingStatus())); // fixme: this should be unified for both clients @@ -210,8 +232,8 @@ void QmlProfilerClientManager::disconnectClientSignals() disconnect(d->v8clientplugin.data(), SIGNAL(complete()), this, SLOT(v8Complete())); disconnect(d->v8clientplugin.data(), SIGNAL(v8range(int,QString,QString,int,double,double)), - this, - SIGNAL(addV8Event(int,QString,QString,int,double,double))); + d->modelManager, + SLOT(addV8Event(int,QString,QString,int,double,double))); disconnect(d->v8clientplugin.data(), SIGNAL(enabledChanged()), d->v8clientplugin.data(), SLOT(sendRecordingStatus())); } |