Utils: Use FilePath in FileUtils::showInGraphicalShell

Change-Id: I393f33a6a31fc6cee3c0a4b16c474247673af312
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
hjk
2021-08-12 12:05:37 +02:00
parent 83ec50a374
commit ba745a45aa
7 changed files with 10 additions and 11 deletions

View File

@@ -70,9 +70,9 @@ static void showGraphicalShellError(QWidget *parent, const QString &app, const Q
ICore::showOptionsDialog(Constants::SETTINGS_ID_INTERFACE, parent);
}
void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
void FileUtils::showInGraphicalShell(QWidget *parent, const FilePath &pathIn)
{
const QFileInfo fileInfo(pathIn);
const QFileInfo fileInfo = pathIn.toFileInfo();
// Mac, Windows support folder or file.
if (HostOsInfo::isWindowsHost()) {
const FilePath explorer = Environment::systemEnvironment().searchInPath(QLatin1String("explorer.exe"));
@@ -85,7 +85,7 @@ void FileUtils::showInGraphicalShell(QWidget *parent, const QString &pathIn)
return;
}
QStringList param;
if (!fileInfo.isDir())
if (!pathIn.isDir())
param += QLatin1String("/select,");
param += QDir::toNativeSeparators(fileInfo.canonicalFilePath());
QProcess::startDetached(explorer.toString(), param);