diff --git a/src/plugins/coreplugin/mainwindow.cpp b/src/plugins/coreplugin/mainwindow.cpp index c67b3b2e3b0..7807575f5d8 100644 --- a/src/plugins/coreplugin/mainwindow.cpp +++ b/src/plugins/coreplugin/mainwindow.cpp @@ -1070,10 +1070,12 @@ void MainWindow::aboutToShowRecentFiles() for (int i = 0; i < recentFiles.count(); ++i) { const DocumentManager::RecentFile file = recentFiles[i]; - int acceleratorKey = i + 1; - QString textPattern = acceleratorKey < 10 ? QStringLiteral("&%1: %2") : QStringLiteral("%1: %2"); - QString filePath = QDir::toNativeSeparators(withTildeHomePath(file.first)); - QString actionText = textPattern.arg(acceleratorKey).arg(filePath); + const int acceleratorKey = i + 1; + const QString textPattern = acceleratorKey < 10 ? QStringLiteral("&%1: %2") : QStringLiteral("%1: %2"); + const QString filePath = QDir::toNativeSeparators(withTildeHomePath(file.first)); + const QString actionText = HostOsInfo::isMacHost() + ? filePath + : textPattern.arg(acceleratorKey).arg(filePath); QAction *action = menu->addAction(actionText); connect(action, &QAction::triggered, this, [file] { EditorManager::openEditor(file.first, file.second); diff --git a/src/plugins/projectexplorer/projectexplorer.cpp b/src/plugins/projectexplorer/projectexplorer.cpp index 37cdc97f7bf..962922f58eb 100644 --- a/src/plugins/projectexplorer/projectexplorer.cpp +++ b/src/plugins/projectexplorer/projectexplorer.cpp @@ -2830,8 +2830,10 @@ void ProjectExplorerPluginPrivate::updateRecentProjectMenu() if (fileName.endsWith(QLatin1String(".qws"))) continue; - QString textTemplate = acceleratorKey < 10 ? QStringLiteral("&%1: %2") : QStringLiteral("%1: %2"); - QString actionText = textTemplate.arg(acceleratorKey).arg(Utils::withTildeHomePath(fileName)); + const QString textTemplate = acceleratorKey < 10 ? QStringLiteral("&%1: %2") : QStringLiteral("%1: %2"); + const QString actionText = Utils::HostOsInfo::isMacHost() + ? Utils::withTildeHomePath(fileName) + : textTemplate.arg(acceleratorKey).arg(Utils::withTildeHomePath(fileName)); QAction *action = menu->addAction(actionText); connect(action, &QAction::triggered, this, [this, fileName] { openRecentProject(fileName);