QmlProfiler: Don't try to open editor at line 0

There is no line 0, so if the document is already open, the editor
won't move to the beginning. Use line 1 instead, so that we jump to the
location of the corresponding text mark.

Change-Id: I0c5605d2d48b02d73dd97ddc87a527cf1b5dba8f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Ulf Hermann
2016-12-21 12:41:55 +01:00
parent 444e496f5d
commit 3cf6f3d5dd

View File

@@ -458,9 +458,9 @@ void QmlProfilerTool::gotoSourceLocation(const QString &fileUrl, int lineNumber,
// The text editors count columns starting with 0, but the ASTs store the
// location starting with 1, therefore the -1.
EditorManager::openEditorAt(projectFileName, lineNumber, columnNumber - 1, Id(),
EditorManager::DoNotSwitchToDesignMode
| EditorManager::DoNotSwitchToEditMode);
EditorManager::openEditorAt(
projectFileName, lineNumber == 0 ? 1 : lineNumber, columnNumber - 1, Id(),
EditorManager::DoNotSwitchToDesignMode | EditorManager::DoNotSwitchToEditMode);
}
void QmlProfilerTool::updateTimeDisplay()