QmlProfiler: Reduce the amount of useless signals on item selection

By passing signals with identification information of varying accurary
between the different views the event being selected could be changed
while it was selected. By checking the current selection against the
information given in the signal and not reselecting when it matches the
situation is improved.

Also, the selection methods are given more appropriate names. We hardly
ever want to select the "next" event, but rather the "best fitting" one.

Task-number: QTCREATORBUG-11945
Change-Id: I659b4929cb88f4c931a0893aa95a3bc92da5a23b
Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
Ulf Hermann
2014-04-03 11:15:56 +02:00
parent 38220ba4bb
commit 9e802e3af1
7 changed files with 34 additions and 25 deletions

View File

@@ -162,14 +162,12 @@ Rectangle {
rangeDetails.isBindingLoop = false;
}
function selectNextByHash(hash) {
var eventId = qmlProfilerModelProxy.getEventIdForHash(hash);
if (eventId !== -1)
selectNextById(eventId);
}
function selectNextById(eventId)
function selectById(eventId)
{
if (eventId === -1 ||
eventId === qmlProfilerModelProxy.getEventId(view.selectedModel, view.selectedItem))
return;
// this is a slot responding to events from the other pane
// which tracks only events from the basic model
if (!lockItemSelection) {