diff --git a/src/plugins/qmljsinspector/qmljsclientproxy.cpp b/src/plugins/qmljsinspector/qmljsclientproxy.cpp index fb9393d71d808173cf3bf3e76238df53d3c9e275..9db56a375ae26ab9ed6ebb62c5ced4c7b316323e 100644 --- a/src/plugins/qmljsinspector/qmljsclientproxy.cpp +++ b/src/plugins/qmljsinspector/qmljsclientproxy.cpp @@ -43,7 +43,6 @@ #include <QUrl> #include <QAbstractSocket> #include <QDebug> -#include <QFileInfo> using namespace QmlJSInspector::Internal; @@ -199,24 +198,22 @@ QDeclarativeDebugObjectReference ClientProxy::objectReferenceForId(int debugId, return QDeclarativeDebugObjectReference(); } -QList<QDeclarativeDebugObjectReference> ClientProxy::objectReferences(const QUrl &url) const +QList<QDeclarativeDebugObjectReference> ClientProxy::objectReferences() const { QList<QDeclarativeDebugObjectReference> result; foreach(const QDeclarativeDebugObjectReference &it, m_rootObjects) { - result.append(objectReferences(url, it)); + result.append(objectReferences(it)); } return result; } -QList<QDeclarativeDebugObjectReference> ClientProxy::objectReferences(const QUrl &url, - const QDeclarativeDebugObjectReference &objectRef) const +QList<QDeclarativeDebugObjectReference> ClientProxy::objectReferences(const QDeclarativeDebugObjectReference &objectRef) const { QList<QDeclarativeDebugObjectReference> result; - if (objectRef.source().url() == url || url.isEmpty()) - result.append(objectRef); + result.append(objectRef); foreach(const QDeclarativeDebugObjectReference &child, objectRef.children()) { - result.append(objectReferences(url, child)); + result.append(objectReferences(child)); } return result; @@ -353,6 +350,8 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen int lineNum = ref.source().lineNumber(); int colNum = ref.source().columnNumber(); int rev = 0; + + // handle the case where the url contains the revision number encoded. (for object created by the debugger) static QRegExp rx("^(.*)_(\\d+):(\\d+)$"); if (rx.exactMatch(filename)) { filename = rx.cap(1); @@ -365,13 +364,13 @@ void ClientProxy::buildDebugIdHashRecursive(const QDeclarativeDebugObjectReferen if (isShadowBuild && rev == 0) { QString shadowBuildDir = InspectorUi::instance()->debugProjectBuildDirectory(); - //QFileInfo objectFileInfo(filename); if (filename.startsWith(shadowBuildDir)) { ProjectExplorer::Project *debugProject = InspectorUi::instance()->debugProject(); filename = debugProject->projectDirectory() + filename.mid(shadowBuildDir.length()); } } + // append the debug ids in the hash m_debugIdHash[qMakePair<QString, int>(filename, rev)][qMakePair<int, int>(lineNum, colNum)].append(ref.debugId()); foreach(const QDeclarativeDebugObjectReference &it, ref.children()) diff --git a/src/plugins/qmljsinspector/qmljsclientproxy.h b/src/plugins/qmljsinspector/qmljsclientproxy.h index 0642f2ee18d71d2fc1dcab64ac9babf3c108d360..ca87e6f7d09ba9b62e445906c310512190a29447 100644 --- a/src/plugins/qmljsinspector/qmljsclientproxy.h +++ b/src/plugins/qmljsinspector/qmljsclientproxy.h @@ -67,8 +67,8 @@ public: bool resetBindingForObject(int objectDebugId, const QString &propertyName); void clearComponentCache(); - // returns the object references for the given url. - QList<QDeclarativeDebugObjectReference> objectReferences(const QUrl &url = QUrl()) const; + // returns the object references + QList<QDeclarativeDebugObjectReference> objectReferences() const; QDeclarativeDebugObjectReference objectReferenceForId(int debugId) const; QList<QDeclarativeDebugObjectReference> rootObjectReference() const; DebugIdHash debugIdHash() const { return m_debugIdHash; }; @@ -137,7 +137,7 @@ private: bool isDesignClientConnected() const; void reloadEngines(); - QList<QDeclarativeDebugObjectReference> objectReferences(const QUrl &url, const QDeclarativeDebugObjectReference &objectRef) const; + QList<QDeclarativeDebugObjectReference> objectReferences(const QDeclarativeDebugObjectReference &objectRef) const; QDeclarativeDebugObjectReference objectReferenceForId(int debugId, const QDeclarativeDebugObjectReference &ref) const; private: