forked from qt-creator/qt-creator
CMakePM: Fix crash when hovering in CMake file without a project
Fixes: QTCREATORBUG-31077 Change-Id: I60526fb37e5d8c7713a5b22dfddb3e52c50fc5f7 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -330,7 +330,7 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor,
|
|||||||
|
|
||||||
if (auto project = ProjectTree::currentProject()) {
|
if (auto project = ProjectTree::currentProject()) {
|
||||||
buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path());
|
buffer.replace("${CMAKE_SOURCE_DIR}", project->projectDirectory().path());
|
||||||
if (auto bs = ProjectTree::currentBuildSystem(); bs->buildConfiguration()) {
|
if (auto bs = ProjectTree::currentBuildSystem(); bs && bs->buildConfiguration()) {
|
||||||
buffer.replace("${CMAKE_BINARY_DIR}", bs->buildConfiguration()->buildDirectory().path());
|
buffer.replace("${CMAKE_BINARY_DIR}", bs->buildConfiguration()->buildDirectory().path());
|
||||||
|
|
||||||
// Get the path suffix from current source dir to project source dir and apply it
|
// Get the path suffix from current source dir to project source dir and apply it
|
||||||
|
Reference in New Issue
Block a user