Recent Sessions/Projects/Files: Clean up accelerators

Don't show them for sessions on macOS, don't show any numbers > 9, and
don't use colons.

Change-Id: I34a60631e5d11a98f22cfcf374f8cec1a2964658
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Eike Ziller
2016-09-27 11:07:12 +02:00
parent ea0643c3ab
commit 2f9a721fbf
4 changed files with 13 additions and 12 deletions

View File

@@ -1070,12 +1070,8 @@ void MainWindow::aboutToShowRecentFiles()
for (int i = 0; i < recentFiles.count(); ++i) {
const DocumentManager::RecentFile file = recentFiles[i];
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);
const QString actionText = ActionManager::withNumberAccelerator(filePath, i + 1);
QAction *action = menu->addAction(actionText);
connect(action, &QAction::triggered, this, [file] {
EditorManager::openEditor(file.first, file.second);