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 <orgads@gmail.com>
Reviewed-by: Serhii Moroz <frost.asm@gmail.com>
This commit is contained in:
Eike Ziller
2016-09-15 15:24:11 +02:00
parent cfa456b29a
commit 2f4e2e565a
2 changed files with 10 additions and 6 deletions

View File

@@ -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);

View File

@@ -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);