Add convenient wxFileName::GetAbsolutePath() wrapper and use it

This wrapper simply combines the calls to MakeAbsolute() and
GetFullPath(), but using it results in shorter and more clear code, so
it seems to be worth having.
This commit is contained in:
Vadim Zeitlin
2021-07-11 14:48:57 +01:00
parent 3539a81a8a
commit f37d449208
14 changed files with 38 additions and 49 deletions

View File

@@ -748,9 +748,7 @@ void WebFrame::OnLoadScheme(wxCommandEvent& WXUNUSED(evt))
pathlist.Add("../help");
pathlist.Add("../../../samples/help");
wxFileName helpfile(pathlist.FindValidPath("doc.zip"));
helpfile.MakeAbsolute();
wxString path = helpfile.GetFullPath();
wxString path = wxFileName(pathlist.FindValidPath("doc.zip")).GetAbsolutePath();
//Under MSW we need to flip the slashes
path.Replace("\\", "/");
path = "wxfs:///" + path + ";protocol=zip/doc.htm";