Avoid calling wxGetenv() twice unnecessarily
Use wxGetEnv() helper function which allows to write the code in more natural and (slightly) more efficient way. No real changes.
This commit is contained in:
@@ -268,13 +268,14 @@ wxString wxStandardPaths::GetUserDir(Dir userDir) const
|
|||||||
// the version of wxWidgets used by the application.
|
// the version of wxWidgets used by the application.
|
||||||
|
|
||||||
wxLogNull logNull;
|
wxLogNull logNull;
|
||||||
wxString homeDir = wxFileName::GetHomeDir();
|
const wxString homeDir = wxFileName::GetHomeDir();
|
||||||
if (userDir == Dir_Cache)
|
if (userDir == Dir_Cache)
|
||||||
{
|
{
|
||||||
if (wxGetenv(wxT("XDG_CACHE_HOME")))
|
wxString cacheDir;
|
||||||
return wxGetenv(wxT("XDG_CACHE_HOME"));
|
if ( !wxGetEnv(wxS("XDG_CACHE_HOME"), &cacheDir) )
|
||||||
else
|
cacheDir = homeDir + wxS("/.cache");
|
||||||
return homeDir + wxT("/.cache");
|
|
||||||
|
return cacheDir;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString dirsFile = GetXDGConfigHome() + wxT("/user-dirs.dirs");
|
wxString dirsFile = GetXDGConfigHome() + wxT("/user-dirs.dirs");
|
||||||
|
Reference in New Issue
Block a user