Revert incompatible change to Unix wxStandardPaths::GetUserDir()

There is no reason to break the behaviour of the existing code, which doesn't
call SetFileLayout(FileLayout_XDG), by not returning the correct directories
from GetUserDir(Dir_Downloads) and similar any longer.
This commit is contained in:
Vadim Zeitlin
2017-03-09 17:56:45 +01:00
parent 5cf9fcbb1a
commit a44b61e976

View File

@@ -251,14 +251,13 @@ wxStandardPaths::GetLocalizedResourcesDir(const wxString& lang,
wxString wxStandardPaths::GetUserDir(Dir userDir) const
{
switch ( GetFileLayout() )
{
case FileLayout_Classic:
// Fall back to the base class below.
break;
// Note that we do not use the file layout here because there is no reason
// not to respect the XDG convention even if SetFileLayout(FileLayout_XDG)
// hadn't been called: we're not bound by any backwards compatibility
// considerations as there can't be any pre-existing config or data files
// in the home directory that wouldn't be found any longer after updating
// the version of wxWidgets used by the application.
case FileLayout_XDG:
{
wxLogNull logNull;
wxString homeDir = wxFileName::GetHomeDir();
if (userDir == Dir_Cache)
@@ -324,9 +323,6 @@ wxString wxStandardPaths::GetUserDir(Dir userDir) const
}
}
}
}
break;
}
return wxStandardPathsBase::GetUserDir(userDir);
}