From ac37146e27ac0c85a28e31994e35f9cd9cd6b9c8 Mon Sep 17 00:00:00 2001 From: hjk Date: Mon, 4 Nov 2019 09:10:35 +0100 Subject: ProjectExplorer: Export findFileInSession() Would be useful for https://github.com/JakeSays/QtCreatorTerminalPlugin/ Change-Id: I6629c95535b5ce7af8f9d486005f41598b8dff47 Reviewed-by: Christian Kandeler --- src/plugins/projectexplorer/fileinsessionfinder.cpp | 5 +++-- src/plugins/projectexplorer/fileinsessionfinder.h | 7 ++++--- src/plugins/projectexplorer/task.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/plugins/projectexplorer/fileinsessionfinder.cpp b/src/plugins/projectexplorer/fileinsessionfinder.cpp index 8d42c409ad..204fa0f9af 100644 --- a/src/plugins/projectexplorer/fileinsessionfinder.cpp +++ b/src/plugins/projectexplorer/fileinsessionfinder.cpp @@ -79,11 +79,12 @@ FilePathList FileInSessionFinder::doFindFile(const FilePath &filePath) return m_finder.findFile(QUrl::fromLocalFile(filePath.toString())); } +} // namespace Internal + FilePathList findFileInSession(const FilePath &filePath) { - static FileInSessionFinder finder; + static Internal::FileInSessionFinder finder; return finder.doFindFile(filePath); } -} // namespace Internal } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/fileinsessionfinder.h b/src/plugins/projectexplorer/fileinsessionfinder.h index f14b3708f3..307018a2fc 100644 --- a/src/plugins/projectexplorer/fileinsessionfinder.h +++ b/src/plugins/projectexplorer/fileinsessionfinder.h @@ -25,12 +25,13 @@ #pragma once +#include "projectexplorer_export.h" + #include namespace ProjectExplorer { -namespace Internal { -Utils::FilePathList findFileInSession(const Utils::FilePath &filePath); +// Possibly used by "QtCreatorTerminalPlugin" +PROJECTEXPLORER_EXPORT Utils::FilePathList findFileInSession(const Utils::FilePath &filePath); -} // namespace Internal } // namespace ProjectExplorer diff --git a/src/plugins/projectexplorer/task.cpp b/src/plugins/projectexplorer/task.cpp index 2a323f0041..8b0b67a1eb 100644 --- a/src/plugins/projectexplorer/task.cpp +++ b/src/plugins/projectexplorer/task.cpp @@ -124,7 +124,7 @@ void Task::setFile(const Utils::FilePath &file_) { file = file_; if (!file.isEmpty() && !file.toFileInfo().isAbsolute()) { - Utils::FilePathList possiblePaths = Internal::findFileInSession(file); + Utils::FilePathList possiblePaths = findFileInSession(file); if (possiblePaths.length() == 1) file = possiblePaths.first(); else -- cgit v1.2.1