]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/stdpbase.cpp
Include wx/brush.h according to precompiled headers of wx/wx.h (with other minor...
[wxWidgets.git] / src / common / stdpbase.cpp
index ab6b882ef6b9b0f6f19ddab865c1683990033126..18ad257b928229bf56eb1e518faf05110edbaed4 100644 (file)
@@ -24,6 +24,8 @@
     #pragma hdrstop
 #endif
 
+#if wxUSE_STDPATHS
+
 #ifndef WX_PRECOMP
     #include "wx/app.h"
 #endif //WX_PRECOMP
@@ -45,7 +47,10 @@ static wxStandardPaths gs_stdPaths;
 /* static */
 wxStandardPathsBase& wxStandardPathsBase::Get()
 {
-    return wxTheApp->GetTraits()->GetStandardPaths();
+    wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
+    wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") );
+
+    return traits->GetStandardPaths();
 }
 
 wxStandardPathsBase& wxAppTraitsBase::GetStandardPaths()
@@ -68,12 +73,17 @@ wxString wxStandardPathsBase::GetUserLocalDataDir() const
     return GetUserDataDir();
 }
 
+wxString wxStandardPathsBase::GetDocumentsDir() const
+{
+    return wxFileName::GetHomeDir();
+}
+
 /* static */
 wxString wxStandardPathsBase::AppendAppName(const wxString& dir)
 {
     wxString subdir(dir);
 
-    // empty string indicates that an error has occured, don't touch it then
+    // empty string indicates that an error has occurred, don't touch it then
     if ( !subdir.empty() )
     {
         const wxString appname = wxTheApp->GetAppName();
@@ -90,3 +100,4 @@ wxString wxStandardPathsBase::AppendAppName(const wxString& dir)
     return subdir;
 }
 
+#endif // wxUSE_STDPATHS