QmlProfiler: Fix selection by typeId

Selection propagation by typeId was still using the old general
aggregator methods that have been removed by now.

Change-Id: I955149e6ed8f3d6274a2a15a882e1f10341302e4
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
This commit is contained in:
Ulf Hermann
2014-12-16 10:46:10 +01:00
parent b1cd118cff
commit 2b7a9f50b4

View File

@@ -115,10 +115,17 @@ Rectangle {
var itemIndex = -1; var itemIndex = -1;
var modelIndex = -1; var modelIndex = -1;
var notes = timelineModelAggregator.notesByTypeId(typeId);
var notesModel = timelineModelAggregator.notes;
var notes = notesModel ? notesModel.byTypeId(typeId) : [];
if (notes.length !== 0) { if (notes.length !== 0) {
modelIndex = timelineModelAggregator.noteTimelineModel(notes[0]); itemIndex = notesModel.timelineIndex(notes[0]);
itemIndex = timelineModelAggregator.noteTimelineIndex(notes[0]); var modelId = notesModel.timelineModel(notes[0]);
for (modelIndex = 0; modelIndex < timelineModelAggregator.models.length;
++modelIndex) {
if (timelineModelAggregator.models[modelIndex].modelId === modelId)
break;
}
} else { } else {
for (modelIndex = 0; modelIndex < timelineModelAggregator.models.length; ++modelIndex) { for (modelIndex = 0; modelIndex < timelineModelAggregator.models.length; ++modelIndex) {
if (modelIndex === selectedModel && selectedItem !== -1 && if (modelIndex === selectedModel && selectedItem !== -1 &&
@@ -135,7 +142,8 @@ Rectangle {
} }
} }
if (itemIndex !== -1) { if (modelIndex !== -1 && modelIndex < timelineModelAggregator.models.length &&
itemIndex !== -1) {
// select an item, lock to it, and recenter if necessary // select an item, lock to it, and recenter if necessary
content.select(modelIndex, itemIndex); content.select(modelIndex, itemIndex);
content.selectionLocked = true; content.selectionLocked = true;