QmlJSInspector: Fixed multi-selection bug

Nothing useful can be done with multi-selection at the moment, but this
bug was introduced in 8d0601515e and is
better to fix straight away.

What happened was that when multiple items are selected in the observed
QML application, Qt Creator would pick the first and send that back as
the new selection. This made it impossible to select more than one item.

Task-number: QTCREATORBUG-3426
Change-Id: I68283480af5e0a21e32e51a49848ff9a809ed5ec
Reviewed-on: http://codereview.qt.nokia.com/151
Reviewed-by: Kai Koehne <kai.koehne@nokia.com>
This commit is contained in:
Thorbjørn Lindeijer
2011-05-26 14:21:44 +02:00
committed by Kai Koehne
parent 70ca0e32bb
commit 5647e67762
3 changed files with 17 additions and 3 deletions

View File

@@ -145,6 +145,14 @@ void ClientProxy::onCurrentObjectsChanged(const QList<int> &debugIds, bool reque
emit selectedItemsChanged(selectedItems);
}
void ClientProxy::setSelectedItemsByDebugId(const QList<int> &debugIds)
{
if (!isConnected())
return;
m_observerClient->setCurrentObjects(debugIds);
}
void ClientProxy::setSelectedItemsByObjectId(const QList<QDeclarativeDebugObjectReference> &objectRefs)
{
if (isConnected()) {

View File

@@ -85,6 +85,7 @@ public:
bool isConnected() const;
void setSelectedItemsByDebugId(const QList<int> &debugIds);
void setSelectedItemsByObjectId(const QList<QDeclarativeDebugObjectReference> &objectRefs);
QList<QDeclarativeDebugEngineReference> engines() const;

View File

@@ -543,7 +543,6 @@ void InspectorUi::selectItems(const QList<QDeclarativeDebugObjectReference> &obj
m_propertyInspector->setCurrentObjects(selectionList);
populateCrumblePath(objref);
gotoObjectReferenceDefinition(objref);
m_clientProxy->setSelectedItemsByObjectId(selectionList);
return;
}
}
@@ -762,8 +761,14 @@ void InspectorUi::setupDockWidgets()
void InspectorUi::crumblePathElementClicked(int debugId)
{
if (debugId != -1)
selectItems(QList<int>() << debugId);
if (debugId == -1)
return;
QList<int> debugIds;
debugIds << debugId;
selectItems(debugIds);
m_clientProxy->setSelectedItemsByDebugId(debugIds);
}
bool InspectorUi::showExperimentalWarning()