Use a more specific path for instance checker
This commit is contained in:
parent
e55a803572
commit
874be359e0
|
@ -385,6 +385,16 @@ wxString PATHS::GetDocumentationPath()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxString PATHS::GetInstanceCheckerPath()
|
||||||
|
{
|
||||||
|
wxFileName path;
|
||||||
|
path.AssignDir( wxStandardPaths::Get().GetTempDir() );
|
||||||
|
path.AppendDir( "kicad" );
|
||||||
|
path.AppendDir( "instances" );
|
||||||
|
return path.GetPathWithSep();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
bool PATHS::EnsurePathExists( const wxString& aPath )
|
bool PATHS::EnsurePathExists( const wxString& aPath )
|
||||||
{
|
{
|
||||||
wxFileName path( aPath );
|
wxFileName path( aPath );
|
||||||
|
|
|
@ -489,8 +489,12 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
wxString instanceCheckerDir = PATHS::GetInstanceCheckerPath();
|
||||||
|
PATHS::EnsurePathExists( instanceCheckerDir );
|
||||||
|
|
||||||
m_pgm_checker = std::make_unique<wxSingleInstanceChecker>();
|
m_pgm_checker = std::make_unique<wxSingleInstanceChecker>();
|
||||||
m_pgm_checker->Create( pgm_name, wxStandardPaths::Get().GetTempDir() );
|
m_pgm_checker->Create( pgm_name, instanceCheckerDir );
|
||||||
|
|
||||||
// Init KiCad environment
|
// Init KiCad environment
|
||||||
// the environment variable KICAD (if exists) gives the kicad path:
|
// the environment variable KICAD (if exists) gives the kicad path:
|
||||||
|
|
|
@ -148,6 +148,11 @@ public:
|
||||||
*/
|
*/
|
||||||
static wxString GetDocumentationPath();
|
static wxString GetDocumentationPath();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets the path used for wxSingleInstanceChecker lock files
|
||||||
|
*/
|
||||||
|
static wxString GetInstanceCheckerPath();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to create a given path if it does not exist
|
* Attempts to create a given path if it does not exist
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue