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 )
|
||||
{
|
||||
wxFileName path( aPath );
|
||||
|
@ -576,4 +586,4 @@ const wxString& PATHS::GetExecutablePath()
|
|||
}
|
||||
|
||||
return exe_path;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -489,8 +489,12 @@ bool PGM_BASE::InitPgm( bool aHeadless, bool aSkipPyInit, bool aIsUnitTest )
|
|||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
wxString instanceCheckerDir = PATHS::GetInstanceCheckerPath();
|
||||
PATHS::EnsurePathExists( instanceCheckerDir );
|
||||
|
||||
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
|
||||
// the environment variable KICAD (if exists) gives the kicad path:
|
||||
|
|
|
@ -148,6 +148,11 @@ public:
|
|||
*/
|
||||
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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue