From 3f0627b75f8fa8d03d22b46c37b100180299b404 Mon Sep 17 00:00:00 2001 From: Udo Hoffmann Date: Mon, 25 May 2020 22:51:43 +0200 Subject: [PATCH] Display file name as root of workspace instead of "Workspace" Close #8314, close #8315 --- PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index 5faf0937e..b4d9941da 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -398,7 +398,8 @@ bool ProjectPanel::openWorkSpace(const TCHAR *projectFileName) NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); generic_string workspace = pNativeSpeaker->getAttrNameStr(PM_WORKSPACEROOTNAME, "ProjectManager", "WorkspaceRootName"); - HTREEITEM rootItem = _treeView.addItem(workspace.c_str(), TVI_ROOT, INDEX_CLEAN_ROOT); + TCHAR * fileName = PathFindFileName(projectFileName); + HTREEITEM rootItem = _treeView.addItem(fileName, TVI_ROOT, INDEX_CLEAN_ROOT); for ( ; childNode ; childNode = childNode->NextSibling(TEXT("Project"))) { @@ -454,6 +455,9 @@ bool ProjectPanel::writeWorkSpace(TCHAR *projectFileName) if (!tvRoot) return false; + TCHAR * fileName = PathFindFileName(projectFileName); + _treeView.renameItem(tvRoot, fileName); + for (HTREEITEM tvProj = _treeView.getChildFrom(tvRoot); tvProj != NULL; tvProj = _treeView.getNextSibling(tvProj))