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:
@@ -44,9 +44,7 @@ wxString AutoCaptureMechanism::default_dir = wxT("screenshots");
|
||||
/* static */
|
||||
wxString AutoCaptureMechanism::GetDefaultDirectoryAbsPath()
|
||||
{
|
||||
wxFileName output = wxFileName::DirName(GetDefaultDirectory());
|
||||
output.MakeAbsolute();
|
||||
return output.GetFullPath();
|
||||
return wxFileName::DirName(GetDefaultDirectory()).GetAbsolutePath();
|
||||
}
|
||||
|
||||
/* static */
|
||||
|
@@ -337,9 +337,7 @@ void XmlResApp::ParseParams(const wxCmdLineParser& cmdline)
|
||||
}
|
||||
if (!parOutput.empty())
|
||||
{
|
||||
wxFileName fn(parOutput);
|
||||
fn.MakeAbsolute();
|
||||
parOutput = fn.GetFullPath();
|
||||
parOutput = wxFileName(parOutput).GetAbsolutePath();
|
||||
parOutputPath = wxPathOnly(parOutput);
|
||||
}
|
||||
if (!parOutputPath) parOutputPath = wxT(".");
|
||||
|
Reference in New Issue
Block a user