Forbid creation of wxStandardPaths object directly.
This happens to work under MSW and Unix where there is only one wxStandardPaths class for both the console and the GUI applications but doesn't return the correct result under OS X where the Core Foundation version, returned by wxStandardPaths::Get(), has to be used for the GUI programs. And historically this confused a lot of people, so just ensure that they can't accidentally create an object of the wrong type any more. Closes #13537. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,7 +36,21 @@
|
||||
// module globals
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
static wxStandardPaths gs_stdPaths;
|
||||
namespace
|
||||
{
|
||||
|
||||
// Derive a class just to be able to create it: wxStandardPaths ctor is
|
||||
// protected to prevent its misuse, but it also means we can't create an object
|
||||
// of this class directly.
|
||||
class wxStandardPathsDefault : public wxStandardPaths
|
||||
{
|
||||
public:
|
||||
wxStandardPathsDefault() { }
|
||||
};
|
||||
|
||||
static wxStandardPathsDefault gs_stdPaths;
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
// ============================================================================
|
||||
// implementation
|
||||
|
||||
Reference in New Issue
Block a user