return wxStandardPaths, not wxStandardPathsBase, from wxStandardPathsBase::Get() to allow calling platform-specific methods on it if necessary

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@60935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-06-06 23:34:05 +00:00
parent 5470512797
commit 25f49256ac
6 changed files with 10 additions and 8 deletions

View File

@@ -25,7 +25,7 @@ class WXDLLIMPEXP_FWD_BASE wxLog;
class WXDLLIMPEXP_FWD_BASE wxMessageOutput; class WXDLLIMPEXP_FWD_BASE wxMessageOutput;
class WXDLLIMPEXP_FWD_BASE wxObject; class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_CORE wxRendererNative; class WXDLLIMPEXP_FWD_CORE wxRendererNative;
class WXDLLIMPEXP_FWD_BASE wxStandardPathsBase; class WXDLLIMPEXP_FWD_BASE wxStandardPaths;
class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_BASE wxTimer; class WXDLLIMPEXP_FWD_BASE wxTimer;
class WXDLLIMPEXP_FWD_BASE wxTimerImpl; class WXDLLIMPEXP_FWD_BASE wxTimerImpl;
@@ -75,7 +75,7 @@ public:
// wxStandardPaths object is normally the same for wxBase and wxGUI // wxStandardPaths object is normally the same for wxBase and wxGUI
// except in the case of wxMac and wxCocoa // except in the case of wxMac and wxCocoa
virtual wxStandardPathsBase& GetStandardPaths(); virtual wxStandardPaths& GetStandardPaths();
#if wxUSE_INTL #if wxUSE_INTL
// called during wxApp initialization to set the locale to correspond to // called during wxApp initialization to set the locale to correspond to

View File

@@ -17,6 +17,8 @@
#include "wx/string.h" #include "wx/string.h"
#include "wx/filefn.h" #include "wx/filefn.h"
class WXDLLIMPEXP_FWD_BASE wxStandardPaths;
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxStandardPaths returns the standard locations in the file system // wxStandardPaths returns the standard locations in the file system
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
@@ -50,7 +52,7 @@ public:
// return the global standard paths object // return the global standard paths object
static wxStandardPathsBase& Get(); static wxStandardPaths& Get();
// return the path (directory+filename) of the running executable or // return the path (directory+filename) of the running executable or
// wxEmptyString if it couldn't be determined. // wxEmptyString if it couldn't be determined.

View File

@@ -62,7 +62,7 @@ public:
#endif #endif
#if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS #if (defined(__WXMAC__) || defined(__WXCOCOA__)) && wxUSE_STDPATHS
virtual wxStandardPathsBase& GetStandardPaths(); virtual wxStandardPaths& GetStandardPaths();
#endif #endif
virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const; virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const;

View File

@@ -51,7 +51,7 @@ public:
/** /**
Returns reference to the unique global standard paths object. Returns reference to the unique global standard paths object.
*/ */
static wxStandardPathsBase& Get(); static wxStandardPaths& Get();
/** /**
Return the directory for the document files used by this application. Return the directory for the document files used by this application.

View File

@@ -43,7 +43,7 @@ static wxStandardPaths gs_stdPaths;
// ============================================================================ // ============================================================================
/* static */ /* static */
wxStandardPathsBase& wxStandardPathsBase::Get() wxStandardPaths& wxStandardPathsBase::Get()
{ {
wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL; wxAppTraits * const traits = wxTheApp ? wxTheApp->GetTraits() : NULL;
wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") ); wxCHECK_MSG( traits, gs_stdPaths, _T("create wxApp before calling this") );
@@ -72,7 +72,7 @@ wxString wxStandardPathsBase::GetExecutablePath() const
return filename.GetFullPath(); return filename.GetFullPath();
} }
wxStandardPathsBase& wxAppTraitsBase::GetStandardPaths() wxStandardPaths& wxAppTraitsBase::GetStandardPaths()
{ {
return gs_stdPaths; return gs_stdPaths;
} }

View File

@@ -110,7 +110,7 @@ int wxGUIAppTraits::AddProcessCallback(wxEndProcessData *proc_data, int fd)
// put it in because it's already compiled for wxCocoa and wxMac GUI lib. // put it in because it's already compiled for wxCocoa and wxMac GUI lib.
#if wxUSE_STDPATHS #if wxUSE_STDPATHS
static wxStandardPathsCF gs_stdPaths; static wxStandardPathsCF gs_stdPaths;
wxStandardPathsBase& wxGUIAppTraits::GetStandardPaths() wxStandardPaths& wxGUIAppTraits::GetStandardPaths()
{ {
return gs_stdPaths; return gs_stdPaths;
} }