Display file name as root of workspace instead of "Workspace"

Close #8314, close #8315
This commit is contained in:
Udo Hoffmann 2020-05-25 22:51:43 +02:00 committed by Don HO
parent b037bb5c95
commit 3f0627b75f
No known key found for this signature in database
GPG Key ID: 6C429F1D8D84F46E

View File

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