forked from qt-creator/qt-creator
Utils: Move PathChooser::expandedDirectory() to its only user
... and simplify its use given the always empty base dir there. Change-Id: Ieeff7f31653db1512edc2cc448f80efc9bb7222e Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -354,20 +354,6 @@ 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)
|
||||
{
|
||||
if (input.isEmpty())
|
||||
return input;
|
||||
const QString path = QDir::cleanPath(env.expandVariables(input));
|
||||
if (path.isEmpty())
|
||||
return path;
|
||||
if (!baseDir.isEmpty() && QFileInfo(path).isRelative())
|
||||
return QFileInfo(baseDir + '/' + path).absoluteFilePath();
|
||||
return path;
|
||||
}
|
||||
|
||||
void PathChooser::setPath(const QString &path)
|
||||
{
|
||||
QTC_ASSERT(!d->m_callGuard.isLocked(), return);
|
||||
|
||||
Reference in New Issue
Block a user