diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index e3c6291841e..3aaa87b0de5 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -650,7 +650,7 @@ void AndroidBuildApkStep::setupOutputFormatter(OutputFormatter *formatter) void AndroidBuildApkStep::showInGraphicalShell() { - Core::FileUtils::showInGraphicalShell(Core::ICore::dialogParent(), m_packagePath); + Core::FileUtils::showInGraphicalShell(Core::ICore::dialogParent(), FilePath::fromString(m_packagePath)); } QWidget *AndroidBuildApkStep::createConfigWidget() diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index 0ac5b460a3f..b9475989203 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -327,7 +327,7 @@ void CorePlugin::addToPathChooserContextMenu(Utils::PathChooser *pathChooser, QM if (QDir().exists(pathChooser->filePath().toString())) { auto *showInGraphicalShell = new QAction(Core::FileUtils::msgGraphicalShellAction(), menu); connect(showInGraphicalShell, &QAction::triggered, pathChooser, [pathChooser]() { - Core::FileUtils::showInGraphicalShell(pathChooser, pathChooser->filePath().toString()); + Core::FileUtils::showInGraphicalShell(pathChooser, pathChooser->filePath()); }); menu->insertAction(firstAction, showInGraphicalShell); diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 219d1ccd02b..e2e26201ef2 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -534,7 +534,7 @@ void EditorManagerPrivate::init() return; const FilePath fp = EditorManager::currentDocument()->filePath(); if (!fp.isEmpty()) - FileUtils::showInGraphicalShell(ICore::dialogParent(), fp.toString()); + FileUtils::showInGraphicalShell(ICore::dialogParent(), fp); }); //Save XXX Context Actions @@ -564,8 +564,7 @@ void EditorManagerPrivate::init() connect(m_openGraphicalShellContextAction, &QAction::triggered, this, [this] { if (!m_contextMenuEntry || m_contextMenuEntry->fileName().isEmpty()) return; - FileUtils::showInGraphicalShell(ICore::dialogParent(), - m_contextMenuEntry->fileName().toString()); + FileUtils::showInGraphicalShell(ICore::dialogParent(), m_contextMenuEntry->fileName()); }); connect(m_openTerminalAction, &QAction::triggered, this, &EditorManagerPrivate::openTerminal); connect(m_findInDirectoryAction, &QAction::triggered, diff --git a/src/plugins/coreplugin/fileutils.cpp b/src/plugins/coreplugin/fileutils.cpp index 59ee2f42636..95ea1313d19 100644 --- a/src/plugins/coreplugin/fileutils.cpp +++ b/src/plugins/coreplugin/fileutils.cpp @@ -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); diff --git a/src/plugins/coreplugin/fileutils.h b/src/plugins/coreplugin/fileutils.h index c1b79115076..eadefadc046 100644 --- a/src/plugins/coreplugin/fileutils.h +++ b/src/plugins/coreplugin/fileutils.h @@ -42,7 +42,7 @@ enum class HandleIncludeGuards { No, Yes }; struct CORE_EXPORT FileUtils { // Helpers for common directory browser options. - static void showInGraphicalShell(QWidget *parent, const QString &path); + static void showInGraphicalShell(QWidget *parent, const Utils::FilePath &path); static void openTerminal(const Utils::FilePath &path); static void openTerminal(const Utils::FilePath &path, const Utils::Environment &env); static QString msgFindInDirectory(); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index bb790b917cd..59dc31de0c1 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -3693,7 +3693,7 @@ void ProjectExplorerPluginPrivate::showInGraphicalShell() { Node *currentNode = ProjectTree::currentNode(); QTC_ASSERT(currentNode, return); - Core::FileUtils::showInGraphicalShell(ICore::dialogParent(), currentNode->path().toString()); + Core::FileUtils::showInGraphicalShell(ICore::dialogParent(), currentNode->path()); } void ProjectExplorerPluginPrivate::openTerminalHere(const EnvironmentGetter &env) diff --git a/src/plugins/qmldesigner/assetexporterplugin/assetexportdialog.cpp b/src/plugins/qmldesigner/assetexporterplugin/assetexportdialog.cpp index a80d30830f0..c7850cff78c 100644 --- a/src/plugins/qmldesigner/assetexporterplugin/assetexportdialog.cpp +++ b/src/plugins/qmldesigner/assetexporterplugin/assetexportdialog.cpp @@ -91,7 +91,7 @@ AssetExportDialog::AssetExportDialog(const Utils::FilePath &exportPath, m_ui->exportPath->setPromptDialogFilter(tr("Metadata file (*.metadata)")); m_ui->exportPath->lineEdit()->setReadOnly(true); m_ui->exportPath->addButton(tr("Open"), this, [this]() { - Core::FileUtils::showInGraphicalShell(Core::ICore::mainWindow(), m_ui->exportPath->path()); + Core::FileUtils::showInGraphicalShell(Core::ICore::mainWindow(), m_ui->exportPath->filePath()); }); auto optionsWidget = new QWidget;