forked from qt-creator/qt-creator
Docker: Add Filepath::localSource()
FilePath::localSource can return a filepath that represents a local version of a remote file. It is used to let the debugger select the local version of a file when debugging a remote target. Change-Id: Ieb934ef0d454e8ff55e71df41dca825974d85da7 Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -1588,6 +1588,16 @@ FilePath FilePath::resolvePath(const QString &tail) const
|
||||
return resolvePath(FilePath::fromString(tail));
|
||||
}
|
||||
|
||||
expected_str<FilePath> FilePath::localSource() const
|
||||
{
|
||||
if (!needsDevice())
|
||||
return *this;
|
||||
|
||||
QTC_ASSERT(s_deviceHooks.localSource,
|
||||
return make_unexpected(Tr::tr("No 'localSource' device hook set.")));
|
||||
return s_deviceHooks.localSource(*this);
|
||||
}
|
||||
|
||||
// Cleans path part similar to QDir::cleanPath()
|
||||
// - directory separators normalized (that is, platform-native
|
||||
// separators converted to "/") and redundant ones removed, and "."s and ".."s
|
||||
|
||||
Reference in New Issue
Block a user