#9940 VCS now toggles buffer read-only state if locking is not active and it is enabled by VC backend

This commit is contained in:
Stephan Witt 2016-02-20 07:32:56 +01:00
parent 63e982191e
commit 89985bebf9
2 changed files with 8 additions and 2 deletions

View File

@ -328,7 +328,13 @@ string LyXVC::toggleReadOnly()
return log;
}
case VCS::NOLOCKING:
break;
Buffer * b = vcs->owner();
bool const newstate = !b->isReadonly();
string result = "LyXVC: toggle to ";
result += (newstate ? "readonly" : "readwrite");
LYXERR(Debug::LYXVC, result);
b->setReadonly(newstate);
return result;
}
return string();
}

View File

@ -2254,7 +2254,7 @@ bool GIT::prepareFileRevisionEnabled()
bool GIT::toggleReadOnlyEnabled()
{
return false;
return true;
}