diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/cmakeprojectmanager/cmakeeditor.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp index 042cb363c8..d3a4fd1d29 100644 --- a/src/plugins/cmakeprojectmanager/cmakeeditor.cpp +++ b/src/plugins/cmakeprojectmanager/cmakeeditor.cpp @@ -130,12 +130,9 @@ void CMakeEditorWidget::contextMenuEvent(QContextMenuEvent *e) static bool isValidFileNameChar(const QChar &c) { - return c.isLetterOrNumber() - || c == QLatin1Char('.') - || c == QLatin1Char('_') - || c == QLatin1Char('-') - || c == QLatin1Char('/') - || c == QLatin1Char('\\'); + return c.isLetterOrNumber() || c == QLatin1Char('.') || c == QLatin1Char('_') + || c == QLatin1Char('-') || c == QLatin1Char('/') || c == QLatin1Char('\\') || c == '{' + || c == '}' || c == '$'; } void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, @@ -185,9 +182,12 @@ void CMakeEditorWidget::findLinkAt(const QTextCursor &cursor, if (buffer.isEmpty()) return processLinkCallback(link); - // TODO: Resolve variables - QDir dir(textDocument()->filePath().toFileInfo().absolutePath()); + buffer.replace("${CMAKE_CURRENT_SOURCE_DIR}", dir.path()); + buffer.replace("${CMAKE_CURRENT_LIST_DIR}", dir.path()); + + // TODO: Resolve more variables + QString fileName = dir.filePath(buffer); QFileInfo fi(fileName); if (fi.exists()) { |