X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2b147f2e19c90ea74a4f96260ef8954a9bfbe2f1..b4c1fe36b9854cdb404906ba3a181a67f9247e0e:/src/common/stdpbase.cpp?ds=sidebyside diff --git a/src/common/stdpbase.cpp b/src/common/stdpbase.cpp index 04cebb8587..8df8c13843 100644 --- a/src/common/stdpbase.cpp +++ b/src/common/stdpbase.cpp @@ -43,10 +43,10 @@ static wxStandardPaths gs_stdPaths; // ============================================================================ /* static */ -wxStandardPathsBase& wxStandardPathsBase::Get() +wxStandardPaths& wxStandardPathsBase::Get() { wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; - wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") ); + wxCHECK_MSG( traits, gs_stdPaths, wxT("create wxApp before calling this") ); return traits->GetStandardPaths(); } @@ -72,7 +72,7 @@ wxString wxStandardPathsBase::GetExecutablePath() const return filename.GetFullPath(); } -wxStandardPathsBase& wxAppTraitsBase::GetStandardPaths() +wxStandardPaths& wxAppTraitsBase::GetStandardPaths() { return gs_stdPaths; } @@ -106,6 +106,14 @@ wxString wxStandardPathsBase::GetDocumentsDir() const return wxFileName::GetHomeDir(); } +wxString wxStandardPathsBase::GetAppDocumentsDir() const +{ + const wxString docsDir = GetDocumentsDir(); + wxString appDocsDir = AppendAppInfo(docsDir); + + return wxDirExists(appDocsDir) ? appDocsDir : docsDir; +} + // return the temporary directory for the current user wxString wxStandardPathsBase::GetTempDir() const { @@ -113,7 +121,9 @@ wxString wxStandardPathsBase::GetTempDir() const } /* static */ -wxString wxStandardPathsBase::AppendPathComponent(const wxString& dir, const wxString& component) +wxString +wxStandardPathsBase::AppendPathComponent(const wxString& dir, + const wxString& component) { wxString subdir(dir); @@ -123,7 +133,7 @@ wxString wxStandardPathsBase::AppendPathComponent(const wxString& dir, const wxS if ( !component.empty() ) { const wxChar ch = *(subdir.end() - 1); - if ( !wxFileName::IsPathSeparator(ch) && ch != _T('.') ) + if ( !wxFileName::IsPathSeparator(ch) && ch != wxT('.') ) subdir += wxFileName::GetPathSeparator(); subdir += component;