forked from qt-creator/qt-creator
QmlJSInspector: API cleanup
Simplify method names.
This commit is contained in:
@@ -163,7 +163,7 @@ void ClientProxy::refreshObjectTree()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClientProxy::onCurrentObjectsChanged(const QList< int >& debugIds, bool requestIfNeeded)
|
void ClientProxy::onCurrentObjectsChanged(const QList<int> &debugIds, bool requestIfNeeded)
|
||||||
{
|
{
|
||||||
QList<QDeclarativeDebugObjectReference> selectedItems;
|
QList<QDeclarativeDebugObjectReference> selectedItems;
|
||||||
|
|
||||||
@@ -194,7 +194,7 @@ void ClientProxy::setSelectedItemsByObjectId(const QList<QDeclarativeDebugObject
|
|||||||
debugIds << ref.debugId();
|
debugIds << ref.debugId();
|
||||||
}
|
}
|
||||||
|
|
||||||
m_designClient->setSelectedItemsByObjectId(debugIds);
|
m_designClient->setCurrentObjects(debugIds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -401,8 +401,8 @@ void ClientProxy::objectTreeFetched(QDeclarativeDebugQuery::State state)
|
|||||||
emit objectTreeUpdated();
|
emit objectTreeUpdated();
|
||||||
|
|
||||||
if (isConnected()) {
|
if (isConnected()) {
|
||||||
if (!m_designClient->selectedItemIds().isEmpty())
|
if (!m_designClient->currentObjects().isEmpty())
|
||||||
onCurrentObjectsChanged(m_designClient->selectedItemIds(), false);
|
onCurrentObjectsChanged(m_designClient->currentObjects(), false);
|
||||||
|
|
||||||
m_designClient->setObjectIdList(m_rootObjects);
|
m_designClient->setObjectIdList(m_rootObjects);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ void InspectorUi::connected(ClientProxy *clientProxy)
|
|||||||
{
|
{
|
||||||
m_clientProxy = clientProxy;
|
m_clientProxy = clientProxy;
|
||||||
|
|
||||||
connect(m_clientProxy, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)),
|
connect(m_clientProxy, SIGNAL(currentObjectsChanged(QList<QDeclarativeDebugObjectReference>)),
|
||||||
SLOT(setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectReference>)));
|
SLOT(setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectReference>)));
|
||||||
|
|
||||||
connect(m_clientProxy, SIGNAL(enginesChanged()), SLOT(updateEngineList()));
|
connect(m_clientProxy, SIGNAL(enginesChanged()), SLOT(updateEngineList()));
|
||||||
@@ -309,7 +309,7 @@ void InspectorUi::connected(ClientProxy *clientProxy)
|
|||||||
|
|
||||||
void InspectorUi::disconnected()
|
void InspectorUi::disconnected()
|
||||||
{
|
{
|
||||||
disconnect(m_clientProxy, SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)),
|
disconnect(m_clientProxy, SIGNAL(currentObjectsChanged(QList<QDeclarativeDebugObjectReference>)),
|
||||||
this, SLOT(setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectReference>)));
|
this, SLOT(setSelectedItemsByObjectReference(QList<QDeclarativeDebugObjectReference>)));
|
||||||
|
|
||||||
disconnect(m_clientProxy, SIGNAL(enginesChanged()), this, SLOT(updateEngineList()));
|
disconnect(m_clientProxy, SIGNAL(enginesChanged()), this, SLOT(updateEngineList()));
|
||||||
@@ -431,7 +431,7 @@ QmlJSLiveTextPreview *InspectorUi::createPreviewForEditor(Core::IEditor *newEdit
|
|||||||
} else {
|
} else {
|
||||||
preview = new QmlJSLiveTextPreview(doc, initdoc, m_clientProxy, this);
|
preview = new QmlJSLiveTextPreview(doc, initdoc, m_clientProxy, this);
|
||||||
connect(preview,
|
connect(preview,
|
||||||
SIGNAL(selectedItemsChanged(QList<QDeclarativeDebugObjectReference>)),
|
SIGNAL(currentObjectsChanged(QList<QDeclarativeDebugObjectReference>)),
|
||||||
SLOT(changeSelectedItems(QList<QDeclarativeDebugObjectReference>)));
|
SLOT(changeSelectedItems(QList<QDeclarativeDebugObjectReference>)));
|
||||||
connect(preview, SIGNAL(reloadQmlViewerRequested()), m_clientProxy, SLOT(reloadQmlViewer()));
|
connect(preview, SIGNAL(reloadQmlViewerRequested()), m_clientProxy, SLOT(reloadQmlViewer()));
|
||||||
connect(preview, SIGNAL(disableLivePreviewRequested()), SLOT(disableLivePreview()));
|
connect(preview, SIGNAL(disableLivePreviewRequested()), SLOT(disableLivePreview()));
|
||||||
|
|||||||
@@ -75,17 +75,17 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
|
|||||||
int objectCount;
|
int objectCount;
|
||||||
ds >> objectCount;
|
ds >> objectCount;
|
||||||
|
|
||||||
m_selectedItemIds.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_selectedItemIds << debugId;
|
m_currentDebugIds << debugId;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit currentObjectsChanged(m_selectedItemIds);
|
emit currentObjectsChanged(m_currentDebugIds);
|
||||||
} else if (type == "TOOL_CHANGED") {
|
} else if (type == "TOOL_CHANGED") {
|
||||||
int toolId;
|
int toolId;
|
||||||
ds >> toolId;
|
ds >> toolId;
|
||||||
@@ -120,12 +120,12 @@ void QmlJSObserverClient::messageReceived(const QByteArray &message)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<int> QmlJSObserverClient::selectedItemIds() const
|
QList<int> QmlJSObserverClient::currentObjects() const
|
||||||
{
|
{
|
||||||
return m_selectedItemIds;
|
return m_currentDebugIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
void QmlJSObserverClient::setSelectedItemsByObjectId(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;
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ public:
|
|||||||
explicit QmlJSObserverClient(QDeclarativeDebugConnection *client,
|
explicit QmlJSObserverClient(QDeclarativeDebugConnection *client,
|
||||||
QObject *parent = 0);
|
QObject *parent = 0);
|
||||||
|
|
||||||
void setSelectedItemsByObjectId(const QList<int> &debugIds);
|
void setCurrentObjects(const QList<int> &debugIds);
|
||||||
void reloadViewer();
|
void reloadViewer();
|
||||||
void setDesignModeBehavior(bool inDesignMode);
|
void setDesignModeBehavior(bool inDesignMode);
|
||||||
void setAnimationSpeed(qreal slowdownFactor);
|
void setAnimationSpeed(qreal slowdownFactor);
|
||||||
@@ -71,7 +71,7 @@ public:
|
|||||||
void applyChangesToQmlFile();
|
void applyChangesToQmlFile();
|
||||||
void applyChangesFromQmlFile();
|
void applyChangesFromQmlFile();
|
||||||
|
|
||||||
QList<int> selectedItemIds() const;
|
QList<int> currentObjects() const;
|
||||||
|
|
||||||
// ### Qt 4.8: remove if we can have access to qdeclarativecontextdata or id's
|
// ### Qt 4.8: remove if we can have access to qdeclarativecontextdata or id's
|
||||||
void setObjectIdList(const QList<QDeclarativeDebugObjectReference> &objectRoots);
|
void setObjectIdList(const QList<QDeclarativeDebugObjectReference> &objectRoots);
|
||||||
@@ -98,7 +98,7 @@ protected:
|
|||||||
virtual void messageReceived(const QByteArray &);
|
virtual void messageReceived(const QByteArray &);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
QList<int> m_selectedItemIds;
|
QList<int> m_currentDebugIds;
|
||||||
QDeclarativeDebugConnection *m_connection;
|
QDeclarativeDebugConnection *m_connection;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user