forked from qt-creator/qt-creator
Utils: Use FilePath in FileUtils::showInGraphicalShell
Change-Id: I393f33a6a31fc6cee3c0a4b16c474247673af312 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user