forked from qt-creator/qt-creator
ProjectExplorer: Export findFileInSession()
Would be useful for https://github.com/JakeSays/QtCreatorTerminalPlugin/ Change-Id: I6629c95535b5ce7af8f9d486005f41598b8dff47 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -79,11 +79,12 @@ FilePathList FileInSessionFinder::doFindFile(const FilePath &filePath)
|
|||||||
return m_finder.findFile(QUrl::fromLocalFile(filePath.toString()));
|
return m_finder.findFile(QUrl::fromLocalFile(filePath.toString()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
} // namespace Internal
|
||||||
|
|
||||||
FilePathList findFileInSession(const FilePath &filePath)
|
FilePathList findFileInSession(const FilePath &filePath)
|
||||||
{
|
{
|
||||||
static FileInSessionFinder finder;
|
static Internal::FileInSessionFinder finder;
|
||||||
return finder.doFindFile(filePath);
|
return finder.doFindFile(filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
@@ -25,12 +25,13 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
|
|
||||||
namespace ProjectExplorer {
|
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
|
} // namespace ProjectExplorer
|
||||||
|
@@ -124,7 +124,7 @@ void Task::setFile(const Utils::FilePath &file_)
|
|||||||
{
|
{
|
||||||
file = file_;
|
file = file_;
|
||||||
if (!file.isEmpty() && !file.toFileInfo().isAbsolute()) {
|
if (!file.isEmpty() && !file.toFileInfo().isAbsolute()) {
|
||||||
Utils::FilePathList possiblePaths = Internal::findFileInSession(file);
|
Utils::FilePathList possiblePaths = findFileInSession(file);
|
||||||
if (possiblePaths.length() == 1)
|
if (possiblePaths.length() == 1)
|
||||||
file = possiblePaths.first();
|
file = possiblePaths.first();
|
||||||
else
|
else
|
||||||
|
Reference in New Issue
Block a user