forked from qt-creator/qt-creator
QmlJSDebugger: Code cosmetics
This commit is contained in:
@@ -51,7 +51,6 @@ AbstractLiveEditTool::AbstractLiveEditTool(QDeclarativeViewObserver *editorView)
|
|||||||
|
|
||||||
AbstractLiveEditTool::~AbstractLiveEditTool()
|
AbstractLiveEditTool::~AbstractLiveEditTool()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QDeclarativeViewObserver *AbstractLiveEditTool::observer() const
|
QDeclarativeViewObserver *AbstractLiveEditTool::observer() const
|
||||||
@@ -196,4 +195,4 @@ QString AbstractLiveEditTool::titleForItem(QGraphicsItem *item)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
} // namespace QmlJSDebugger
|
||||||
|
|||||||
@@ -119,6 +119,6 @@ private:
|
|||||||
friend class AbstractLiveEditTool;
|
friend class AbstractLiveEditTool;
|
||||||
};
|
};
|
||||||
|
|
||||||
} //namespace QmlJSDebugger
|
} // namespace QmlJSDebugger
|
||||||
|
|
||||||
#endif // QDECLARATIVEVIEWOBSERVER_H
|
#endif // QDECLARATIVEVIEWOBSERVER_H
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace QmlJSInspector {
|
|||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
QmlJSObserverClient::QmlJSObserverClient(QDeclarativeDebugConnection *client,
|
QmlJSObserverClient::QmlJSObserverClient(QDeclarativeDebugConnection *client,
|
||||||
QObject * /*parent*/)
|
QObject * /*parent*/)
|
||||||
: QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), client) ,
|
: QDeclarativeDebugClient(QLatin1String("QDeclarativeObserverMode"), client) ,
|
||||||
m_connection(client)
|
m_connection(client)
|
||||||
{
|
{
|
||||||
@@ -78,12 +78,11 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
|
|||||||
|
|
||||||
m_currentDebugIds.clear();
|
m_currentDebugIds.clear();
|
||||||
|
|
||||||
for(int i = 0; i < objectCount; ++i) {
|
for (int i = 0; i < objectCount; ++i) {
|
||||||
int debugId;
|
int debugId;
|
||||||
ds >> debugId;
|
ds >> debugId;
|
||||||
if (debugId != -1) {
|
if (debugId != -1)
|
||||||
m_currentDebugIds << debugId;
|
m_currentDebugIds << debugId;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
emit currentObjectsChanged(m_currentDebugIds);
|
emit currentObjectsChanged(m_currentDebugIds);
|
||||||
@@ -166,7 +165,8 @@ QList<int> QmlJSObserverClient::currentObjects() const
|
|||||||
return m_currentDebugIds;
|
return m_currentDebugIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSObserverClient::setCurrentObjects(const QList<int> &debugIds) {
|
void QmlJSObserverClient::setCurrentObjects(const QList<int> &debugIds)
|
||||||
|
{
|
||||||
if (!m_connection || !m_connection->isConnected())
|
if (!m_connection || !m_connection->isConnected())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -195,9 +195,8 @@ void recurseObjectIdList(const QDeclarativeDebugObjectReference &ref, QList<int>
|
|||||||
{
|
{
|
||||||
debugIds << ref.debugId();
|
debugIds << ref.debugId();
|
||||||
objectIds << ref.idString();
|
objectIds << ref.idString();
|
||||||
foreach(const QDeclarativeDebugObjectReference &child, ref.children()) {
|
foreach (const QDeclarativeDebugObjectReference &child, ref.children())
|
||||||
recurseObjectIdList(child, debugIds, objectIds);
|
recurseObjectIdList(child, debugIds, objectIds);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSObserverClient::setObjectIdList(const QList<QDeclarativeDebugObjectReference> &objectRoots)
|
void QmlJSObserverClient::setObjectIdList(const QList<QDeclarativeDebugObjectReference> &objectRoots)
|
||||||
@@ -208,9 +207,8 @@ void QmlJSObserverClient::setObjectIdList(const QList<QDeclarativeDebugObjectRef
|
|||||||
QList<int> debugIds;
|
QList<int> debugIds;
|
||||||
QList<QString> objectIds;
|
QList<QString> objectIds;
|
||||||
|
|
||||||
foreach(const QDeclarativeDebugObjectReference &ref, objectRoots) {
|
foreach (const QDeclarativeDebugObjectReference &ref, objectRoots)
|
||||||
recurseObjectIdList(ref, debugIds, objectIds);
|
recurseObjectIdList(ref, debugIds, objectIds);
|
||||||
}
|
|
||||||
|
|
||||||
ObserverProtocol::Message cmd = ObserverProtocol::ObjectIdList;
|
ObserverProtocol::Message cmd = ObserverProtocol::ObjectIdList;
|
||||||
ds << cmd
|
ds << cmd
|
||||||
|
|||||||
Reference in New Issue
Block a user