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:
hjk
2023-01-12 10:40:02 +01:00
parent 156ef28d90
commit ea1d729669
3 changed files with 4 additions and 18 deletions

View File

@@ -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);