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:
@@ -370,15 +370,7 @@ protected:
|
||||
|
||||
static wxString GetCanonicalPath(const wxFileName& path)
|
||||
{
|
||||
wxFileName path_copy = wxFileName(path);
|
||||
if ( !path_copy.MakeAbsolute() )
|
||||
{
|
||||
wxFAIL_MSG(wxString::Format(wxASCII_STR("Unable to normalize path '%s'"),
|
||||
path.GetFullPath()));
|
||||
return wxEmptyString;
|
||||
}
|
||||
|
||||
return path_copy.GetFullPath();
|
||||
return path.GetAbsolutePath();
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user