From 6f4cc3541de15f86a2e77df9dcd147acd502175e Mon Sep 17 00:00:00 2001 From: Roberto Raggi <roberto.raggi@nokia.com> Date: Tue, 29 Jun 2010 14:24:12 +0200 Subject: [PATCH] Start the inspector. --- .../qmljsinspector/qmljsclientproxy.cpp | 11 +++++----- src/plugins/qmljsinspector/qmljsclientproxy.h | 2 -- src/plugins/qmljsinspector/qmljsinspector.cpp | 21 +++++++------------ .../qmljsinspector/qmljsinspectorplugin.cpp | 9 ++++---- 4 files changed, 17 insertions(+), 26 deletions(-) diff --git a/src/plugins/qmljsinspector/qmljsclientproxy.cpp b/src/plugins/qmljsinspector/qmljsclientproxy.cpp index 9fb3cfdf596..e7da4a7c212 100644 --- a/src/plugins/qmljsinspector/qmljsclientproxy.cpp +++ b/src/plugins/qmljsinspector/qmljsclientproxy.cpp @@ -64,10 +64,11 @@ bool ClientProxy::connectToViewer(const QString &host, quint16 port) qDebug() << Q_FUNC_INFO; if (m_client) { - disconnect(m_client, SIGNAL(propertyDumpReceived(QDeclarativeDebugPropertyDump)), - this, SIGNAL(propertyDumpReceived(QDeclarativeDebugPropertyDump))); +#warning disconnect selectedItemsChanged here +#if 0 disconnect(m_client, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)), this, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>))); +#endif emit aboutToDisconnect(); @@ -151,12 +152,12 @@ void ClientProxy::connectionStateChanged() m_client = new QDeclarativeEngineDebug(m_conn, this); emit connected(m_client); - connect(m_client, - SIGNAL(propertyDumpReceived(QDeclarativeDebugPropertyDump)), - SIGNAL(propertyDumpReceived(QDeclarativeDebugPropertyDump))); +#warning add support for selectedItemsChanged here +#if 0 connect(m_client, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)), SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>))); +#endif } reloadEngines(); diff --git a/src/plugins/qmljsinspector/qmljsclientproxy.h b/src/plugins/qmljsinspector/qmljsclientproxy.h index e593abd2913..80937f88fdd 100644 --- a/src/plugins/qmljsinspector/qmljsclientproxy.h +++ b/src/plugins/qmljsinspector/qmljsclientproxy.h @@ -37,7 +37,6 @@ QT_FORWARD_DECLARE_CLASS(QUrl) QT_FORWARD_DECLARE_CLASS(QDeclarativeEngineDebug) QT_FORWARD_DECLARE_CLASS(QDeclarativeDebugConnection) QT_FORWARD_DECLARE_CLASS(QDeclarativeDebugExpressionQuery) -QT_FORWARD_DECLARE_CLASS(QDeclarativeDebugPropertyDump) namespace Debugger { class DebuggerRunControl; @@ -79,7 +78,6 @@ signals: void aboutToReloadEngines(); void enginesChanged(); - void propertyDumpReceived(const QDeclarativeDebugPropertyDump &propertyDump); void selectedItemsChanged(const QList<QDeclarativeDebugObjectReference> &selectedItems); void connected(QDeclarativeEngineDebug *client); diff --git a/src/plugins/qmljsinspector/qmljsinspector.cpp b/src/plugins/qmljsinspector/qmljsinspector.cpp index e6a79dbc789..857c9ba9126 100644 --- a/src/plugins/qmljsinspector/qmljsinspector.cpp +++ b/src/plugins/qmljsinspector/qmljsinspector.cpp @@ -164,14 +164,15 @@ void Inspector::updateEngineList() { qDebug() << Q_FUNC_INFO; - QList<QDeclarativeDebugEngineReference> engines = m_clientProxy->engines(); + const QList<QDeclarativeDebugEngineReference> engines = m_clientProxy->engines(); + +#warning update the QML engines combo if (engines.isEmpty()) qWarning("qmldebugger: no engines found!"); - -#warning update the QML engines combo - if (engines.count() > 0) { - m_clientProxy->queryEngineContext(engines.at(0).debugId()); + else { + const QDeclarativeDebugEngineReference engine = engines.first(); + m_clientProxy->queryEngineContext(engine.debugId()); } } @@ -542,14 +543,6 @@ void Inspector::setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectR gotoObjectReferenceDefinition(objectReferences.first()); } -#if 0 -void QmlInspector::handlePropertyDump(const QDeclarativeDebugPropertyDump &dump) -{ - qDebug() << Q_FUNC_INFO; - m_rewriter->mapObjectToQml(dump.object()); -} -#endif - void Inspector::gotoObjectReferenceDefinition(const QDeclarativeDebugObjectReference &obj) { Q_UNUSED(obj); @@ -586,7 +579,7 @@ QDeclarativeDebugExpressionQuery *Inspector::executeExpression(int objectDebugId if (objectId.length()) { QString quoteWrappedValue = value.toString(); if (addQuotesForData(value)) - quoteWrappedValue = QString("'%1'").arg(quoteWrappedValue); + quoteWrappedValue = QString("'%1'").arg(quoteWrappedValue); // ### FIXME this code is wrong! QString constructedExpression = objectId + "." + propertyName + "=" + quoteWrappedValue; return m_client.data()->queryExpressionResult(objectDebugId, constructedExpression, this); diff --git a/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp b/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp index fa1b980254b..e4168f2c060 100644 --- a/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp +++ b/src/plugins/qmljsinspector/qmljsinspectorplugin.cpp @@ -183,13 +183,12 @@ void InspectorPlugin::activateDebuggerForProject(ProjectExplorer::Project *proje # warning start a QML/JS debugging session using the information stored in the current project #endif -#if 0 // FIXME we probably want to activate the debugger for other projects than QmlProjects, // if they contain Qml files. Some kind of options should exist for this behavior. - QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project); - if (qmlproj && m_inspector->setDebugConfigurationDataFromProject(qmlproj)) - m_inspector->startQmlProjectDebugger(); -#endif + if (QmlProjectManager::QmlProject *qmlproj = qobject_cast<QmlProjectManager::QmlProject*>(project)) { + if (_inspector->setDebugConfigurationDataFromProject(qmlproj)) + _inspector->startQmlProjectDebugger(); + } } } -- GitLab