Utils: Introduce PathChoser::absoluteFilePath()

As we have a valid context to resolve relative files here
this is a good source for absolute files that don't depend
on QFilePath::absolute{File,}Path or similar.

Change-Id: Iaf592aa746023f80de517703e32e6b80a3d0fd7e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
This commit is contained in:
hjk
2021-09-09 17:08:32 +02:00
parent a060ea2ec8
commit 10807aed88
2 changed files with 7 additions and 1 deletions

View File

@@ -357,6 +357,11 @@ FilePath PathChooser::filePath() const
return d->expandedPath(rawFilePath().toString());
}
FilePath PathChooser::absoluteFilePath() const
{
return d->m_baseDirectory.resolvePath(filePath());
}
// FIXME: try to remove again
QString PathChooser::expandedDirectory(const QString &input, const Environment &env,
const QString &baseDir)

View File

@@ -90,7 +90,8 @@ public:
bool isValid() const;
QString errorMessage() const;
FilePath filePath() const;
FilePath filePath() const; // Close to what's in the line edit.
FilePath absoluteFilePath() const; // Relative paths resolved wrt the specified base dir.
QString rawPath() const; // The raw unexpanded input.
FilePath rawFilePath() const; // The raw unexpanded input as FilePath.