Commit 5647e677 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer Committed by Kai Koehne

QmlJSInspector: Fixed multi-selection bug

Nothing useful can be done with multi-selection at the moment, but this
bug was introduced in 8d060151 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/151Reviewed-by: default avatarKai Koehne <kai.koehne@nokia.com>
parent 70ca0e32
......@@ -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()) {
......
......@@ -85,6 +85,7 @@ public:
bool isConnected() const;
void setSelectedItemsByDebugId(const QList<int> &debugIds);
void setSelectedItemsByObjectId(const QList<QDeclarativeDebugObjectReference> &objectRefs);
QList<QDeclarativeDebugEngineReference> engines() const;
......
......@@ -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()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment