Add wxStandardPaths::GetUserDir() to get Desktop, Download etc

All major supported platforms have well defined per-user directories to store
Downloads, Music, Pictures, Videos and the Desktop files. The new method
wxStandardPaths::GetUserDir() allows for a unified way to access these on MSW,
OS X and Unix (if XDG user dirs specification is implemented for the latter).

See https://github.com/wxWidgets/wxWidgets/pull/89
This commit is contained in:
Tobias Taschner
2015-09-07 22:06:48 +02:00
committed by Vadim Zeitlin
parent cfe4b4fd07
commit a0fb808087
11 changed files with 240 additions and 26 deletions

View File

@@ -404,6 +404,11 @@ void InteractiveOutputTestCase::TestStandardPaths()
wxPrintf(wxT("Data dir (user):\t%s\n"), stdp.GetUserDataDir().c_str());
wxPrintf(wxT("Data dir (user local):\t%s\n"), stdp.GetUserLocalDataDir().c_str());
wxPrintf(wxT("Documents dir:\t\t%s\n"), stdp.GetDocumentsDir().c_str());
wxPrintf(wxT("Desktop dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Desktop).c_str());
wxPrintf(wxT("Downloads dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Downloads).c_str());
wxPrintf(wxT("Music dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Music).c_str());
wxPrintf(wxT("Pictures dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Pictures).c_str());
wxPrintf(wxT("Videos dir:\t\t%s\n"), stdp.GetUserDir(wxStandardPaths::Dir_Videos).c_str());
wxPrintf(wxT("Executable path:\t%s\n"), stdp.GetExecutablePath().c_str());
wxPrintf(wxT("Plugins dir:\t\t%s\n"), stdp.GetPluginsDir().c_str());
wxPrintf(wxT("Resources dir:\t\t%s\n"), stdp.GetResourcesDir().c_str());