From 3cf6f3d5dd977ee29c95be98e7758deac4e4a735 Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Wed, 21 Dec 2016 12:41:55 +0100 Subject: [PATCH] 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 --- src/plugins/qmlprofiler/qmlprofilertool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/qmlprofiler/qmlprofilertool.cpp b/src/plugins/qmlprofiler/qmlprofilertool.cpp index ec9d8ed5932..a5cf85cd91d 100644 --- a/src/plugins/qmlprofiler/qmlprofilertool.cpp +++ b/src/plugins/qmlprofiler/qmlprofilertool.cpp @@ -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()