Handle normalization of directory names correctly in wxFileHistory.

Don't use relative path for the directories, which can also be managed by
wxFileHistory, because they don't have any and the old code resulted in
showing an empty string for them.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76179 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2014-03-22 22:03:34 +00:00
parent 8d808db43f
commit cc125e64b3

View File

@@ -137,11 +137,11 @@ void wxFileHistoryBase::AddFileToHistory(const wxString& file)
const wxFileName fnOld(m_fileHistory[i]);
wxString pathInMenu;
if ( fnOld.GetPath() == fnNew.GetPath() )
if ( (fnOld.GetPath() == fnNew.GetPath()) && fnOld.HasName() )
{
pathInMenu = fnOld.GetFullName();
}
else // file in different directory
else // file in different directory or it's not a file but a directory
{
// absolute path; could also set relative path
pathInMenu = m_fileHistory[i];