Allow creating wxSingleInstanceChecker with default name.

This makes it easier to use in common cases: there is no need to come up with
a unique name for the checker any more as sufficiently unique combination of
wxApp::GetAppName() and wxGetUserId() is used if no name was explicitly given.

This is done by calling the new CreateDefault() on demand from
IsAnotherRunning() instead of simply creating the checker with the default
name in the default ctor for compatibility (you had to call Create() after
using the default ctor before and it can only be called once) and because
wxTheApp might not exist yet when wxSingleInstanceChecker is created.

Closes #11166.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@61945 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2009-09-16 12:38:00 +00:00
parent 3c3ead1d15
commit 956b3d92ef
5 changed files with 83 additions and 23 deletions

View File

@@ -117,7 +117,7 @@ bool wxSingleInstanceChecker::Create(const wxString& name,
return m_impl->Create(name);
}
bool wxSingleInstanceChecker::IsAnotherRunning() const
bool wxSingleInstanceChecker::DoIsAnotherRunning() const
{
wxCHECK_MSG( m_impl, false, wxT("must call Create() first") );