forked from qt-creator/qt-creator
QmlJSInspector::DebuggerClient: move the code around
This commit is contained in:
@@ -31,7 +31,6 @@
|
|||||||
#include "qmljsprivateapi.h"
|
#include "qmljsprivateapi.h"
|
||||||
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
|
||||||
|
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QAbstractSocket>
|
#include <QAbstractSocket>
|
||||||
@@ -47,8 +46,7 @@ ClientProxy::ClientProxy(QObject *parent) :
|
|||||||
m_client(0),
|
m_client(0),
|
||||||
m_engineQuery(0),
|
m_engineQuery(0),
|
||||||
m_contextQuery(0),
|
m_contextQuery(0),
|
||||||
m_objectTreeQuery(0),
|
m_objectTreeQuery(0)
|
||||||
m_debuggerRunControl(0)
|
|
||||||
{
|
{
|
||||||
Q_ASSERT(! m_instance);
|
Q_ASSERT(! m_instance);
|
||||||
m_instance = this;
|
m_instance = this;
|
||||||
@@ -157,24 +155,7 @@ void ClientProxy::connectionStateChanged()
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
(void) new DebuggerClient(m_conn);
|
||||||
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
|
||||||
const QList<Debugger::DebuggerRunControlFactory *> factories = pm->getObjects<Debugger::DebuggerRunControlFactory>();
|
|
||||||
ProjectExplorer::RunControl *runControl = 0;
|
|
||||||
|
|
||||||
Debugger::DebuggerStartParameters sp;
|
|
||||||
sp.startMode = Debugger::StartExternal;
|
|
||||||
sp.executable = "qmlviewer"; //FIXME
|
|
||||||
runControl = factories.first()->create(sp);
|
|
||||||
m_debuggerRunControl = qobject_cast<Debugger::DebuggerRunControl *>(runControl);
|
|
||||||
|
|
||||||
QTC_ASSERT(m_debuggerRunControl, return );
|
|
||||||
Debugger::Internal::QmlEngine *engine = qobject_cast<Debugger::Internal::QmlEngine *>(m_debuggerRunControl->engine());
|
|
||||||
QTC_ASSERT(engine, return );
|
|
||||||
(void) new DebuggerClient(m_conn, engine);
|
|
||||||
engine->Debugger::Internal::DebuggerEngine::startDebugger(m_debuggerRunControl);
|
|
||||||
engine->startSuccessful();
|
|
||||||
}
|
|
||||||
|
|
||||||
reloadEngines();
|
reloadEngines();
|
||||||
|
|
||||||
|
|||||||
@@ -117,7 +117,6 @@ private:
|
|||||||
QDeclarativeDebugObjectReference m_rootObject;
|
QDeclarativeDebugObjectReference m_rootObject;
|
||||||
QList<QDeclarativeDebugEngineReference> m_engines;
|
QList<QDeclarativeDebugEngineReference> m_engines;
|
||||||
|
|
||||||
Debugger::DebuggerRunControl *m_debuggerRunControl;
|
|
||||||
friend class QmlJSInspector::Internal::InspectorPlugin;
|
friend class QmlJSInspector::Internal::InspectorPlugin;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -28,12 +28,32 @@
|
|||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
#include "qmljsdebuggerclient.h"
|
#include "qmljsdebuggerclient.h"
|
||||||
|
|
||||||
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
using namespace QmlJSInspector::Internal;
|
using namespace QmlJSInspector::Internal;
|
||||||
|
|
||||||
DebuggerClient::DebuggerClient(QDeclarativeDebugConnection *client, Debugger::Internal::QmlEngine *engine)
|
DebuggerClient::DebuggerClient(QDeclarativeDebugConnection* client)
|
||||||
: QDeclarativeDebugClient(QLatin1String("Debugger"), client)
|
: QDeclarativeDebugClient(QLatin1String("Debugger"), client)
|
||||||
, connection(client), engine(engine)
|
, connection(client)
|
||||||
{
|
{
|
||||||
|
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
|
||||||
|
const QList<Debugger::DebuggerRunControlFactory *> factories = pm->getObjects<Debugger::DebuggerRunControlFactory>();
|
||||||
|
ProjectExplorer::RunControl *runControl = 0;
|
||||||
|
|
||||||
|
Debugger::DebuggerStartParameters sp;
|
||||||
|
sp.startMode = Debugger::StartExternal;
|
||||||
|
sp.executable = "qmlviewer"; //FIXME
|
||||||
|
runControl = factories.first()->create(sp);
|
||||||
|
Debugger::DebuggerRunControl* debuggerRunControl = qobject_cast<Debugger::DebuggerRunControl *>(runControl);
|
||||||
|
|
||||||
|
QTC_ASSERT(debuggerRunControl, return );
|
||||||
|
engine = qobject_cast<Debugger::Internal::QmlEngine *>(debuggerRunControl->engine());
|
||||||
|
QTC_ASSERT(engine, return );
|
||||||
|
|
||||||
|
engine->Debugger::Internal::DebuggerEngine::startDebugger(debuggerRunControl);
|
||||||
|
engine->startSuccessful();
|
||||||
|
|
||||||
connect(engine, SIGNAL(sendMessage(QByteArray)), this, SLOT(slotSendMessage(QByteArray)));
|
connect(engine, SIGNAL(sendMessage(QByteArray)), this, SLOT(slotSendMessage(QByteArray)));
|
||||||
setEnabled(true);
|
setEnabled(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ class DebuggerClient : public QDeclarativeDebugClient
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DebuggerClient(QDeclarativeDebugConnection *client, Debugger::Internal::QmlEngine *engine);
|
DebuggerClient(QDeclarativeDebugConnection *client);
|
||||||
virtual ~DebuggerClient();
|
virtual ~DebuggerClient();
|
||||||
|
|
||||||
public: // attributes
|
public: // attributes
|
||||||
|
|||||||
Reference in New Issue
Block a user