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:
parent
844226e6b9
commit
c7758999af
|
@ -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;
|
||||
|
|
|
@ -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() );
|
||||
|
|
Loading…
Reference in New Issue