Handle LOCKFILE logistics for ro

We need to check if a lockfile is valid to determine if we should
override the lock. Valid() is true if the lockfile couldn't be created
b/c of permissions or if the lockfile could be created and acquired.
This commit is contained in:
Seth Hillbrand 2023-05-31 17:04:32 -07:00
parent 844226e6b9
commit c7758999af
2 changed files with 2 additions and 2 deletions

View File

@ -894,7 +894,7 @@ bool SETTINGS_MANAGER::LoadProject( const wxString& aFullPath, bool aSetActive )
bool readOnly = false;
LOCKFILE lockFile( fullPath );
if( !lockFile )
if( !lockFile.Valid() )
{
wxLogTrace( traceSettings, wxT( "Project %s is locked; opening read-only" ), fullPath );
readOnly = true;

View File

@ -607,7 +607,7 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
std::unique_ptr<LOCKFILE> lock = std::make_unique<LOCKFILE>( fullFileName );
if( !lock->Locked() )
if( !lock->Valid() )
{
msg.Printf( _( "PCB '%s' is already open by '%s' at '%s'." ), wx_filename.GetFullName(),
lock->GetUsername(), lock->GetHostname() );