From 2f4e2e565a7146d38d337d22a51447cd31abf846 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Thu, 15 Sep 2016 15:24:11 +0200 Subject: [PATCH] macOS: Do not show numbers in recent files & projects There are no accelerators on macOS, so these numbers are unnecessary noise. Change-Id: I0402dd961dbe955837e0aa70b92aef33f61d61bd Reviewed-by: Orgad Shaneh Reviewed-by: Serhii Moroz --- src/plugins/coreplugin/mainwindow.cpp | 10 ++++++---- src/plugins/projectexplorer/projectexplorer.cpp | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) 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);