forked from qt-creator/qt-creator
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:
@@ -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)
|
||||
|
@@ -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.
|
||||
|
Reference in New Issue
Block a user