X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3af9f2de592953bec39a58cc871678fa85a3b056..ce7208d49d5ce2ca1dc0b3b83f14f1d04f29c4bf:/src/mac/corefoundation/stdpaths_cf.cpp diff --git a/src/mac/corefoundation/stdpaths_cf.cpp b/src/mac/corefoundation/stdpaths_cf.cpp index 62725328e3..451acd14df 100644 --- a/src/mac/corefoundation/stdpaths_cf.cpp +++ b/src/mac/corefoundation/stdpaths_cf.cpp @@ -27,6 +27,9 @@ #include "wx/stdpaths.h" #include "wx/filename.h" +#ifdef __WXMAC__ +#include "wx/mac/private.h" +#endif #include "wx/mac/corefoundation/cfstring.h" #if defined(__DARWIN__) @@ -103,20 +106,44 @@ wxString wxStandardPathsCF::GetFromFunc(wxCFURLRef (*func)(wxCFBundleRef)) const return ret; } +wxString wxStandardPathsCF::GetDocumentsDir() const +{ +#ifdef __WXMAC__ + return wxMacFindFolderNoSeparator + ( +#if TARGET_API_MAC_OSX + kUserDomain, +#else + kOnSystemDisk, +#endif + kDocumentsFolderType, + kCreateFolder + ); +#else + return wxFileName::GetHomeDir() + wxT("/Documents"); +#endif +} + // ---------------------------------------------------------------------------- // wxStandardPathsCF public API // ---------------------------------------------------------------------------- wxString wxStandardPathsCF::GetConfigDir() const { - // TODO: What do we do for pure Carbon? +#ifdef __WXMAC__ + return wxMacFindFolder((short)kLocalDomain, kPreferencesFolderType, kCreateFolder); +#else return wxT("/Library/Preferences"); +#endif } wxString wxStandardPathsCF::GetUserConfigDir() const { - // TODO: What do we do for pure Carbon? +#ifdef __WXMAC__ + return wxMacFindFolder((short)kUserDomain, kPreferencesFolderType, kCreateFolder); +#else return wxFileName::GetHomeDir() + wxT("/Library/Preferences"); +#endif } wxString wxStandardPathsCF::GetDataDir() const @@ -126,12 +153,20 @@ wxString wxStandardPathsCF::GetDataDir() const wxString wxStandardPathsCF::GetLocalDataDir() const { +#ifdef __WXMAC__ + return AppendAppName(wxMacFindFolder((short)kLocalDomain, kApplicationSupportFolderType, kCreateFolder)); +#else return AppendAppName(wxT("/Library/Application Support")); +#endif } wxString wxStandardPathsCF::GetUserDataDir() const { +#ifdef __WXMAC__ + return AppendAppName(wxMacFindFolder((short)kUserDomain, kApplicationSupportFolderType, kCreateFolder)); +#else return AppendAppName(wxFileName::GetHomeDir() + _T("/Library/Application Support")); +#endif } wxString wxStandardPathsCF::GetPluginsDir() const