ProjectExplorer: Show project name instead with file paths

Now Recent Project menu entry shows project names with file paths.

Fixes: QTCREATORBUG-31753
Change-Id: I1109ffa70c034e38a348e7c07b7b19eb503c6c1e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Artem Sokolovskii
2024-10-08 15:16:59 +02:00
parent e99ee62295
commit f9a1e62499

View File

@@ -3256,8 +3256,8 @@ void ProjectExplorerPluginPrivate::updateRecentProjectMenu()
const QString displayPath = const QString displayPath =
filePath.osType() == OsTypeWindows ? filePath.displayName() filePath.osType() == OsTypeWindows ? filePath.displayName()
: filePath.withTildeHomePath(); : filePath.withTildeHomePath();
const QString actionText = const QString actionText = ActionManager::withNumberAccelerator(
ActionManager::withNumberAccelerator(displayPath, acceleratorKey); displayPath + " (" + item.displayName + ")", acceleratorKey);
QAction *action = menu->addAction(actionText); QAction *action = menu->addAction(actionText);
connect(action, &QAction::triggered, this, [this, filePath] { connect(action, &QAction::triggered, this, [this, filePath] {
openRecentProject(filePath); openRecentProject(filePath);