]> git.lyx.org Git - lyx.git/commitdiff
#9940 VCS now toggles buffer read-only state if locking is not active and it is enabl...
authorStephan Witt <switt@lyx.org>
Sat, 20 Feb 2016 06:32:56 +0000 (07:32 +0100)
committerStephan Witt <switt@lyx.org>
Sat, 20 Feb 2016 06:32:56 +0000 (07:32 +0100)
src/LyXVC.cpp
src/VCBackend.cpp

index 4dbcfd2675f5041bda2285e6950f266cc2fee87a..d48031102b76436b578f667e76c9f6aa66e57f73 100644 (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();
 }
index 6350766dac7e57ef324c31f055182bd244b9239b..e0d9b4cce48138ce8d7b62fecb5c81d357a33be8 100644 (file)
@@ -2254,7 +2254,7 @@ bool GIT::prepareFileRevisionEnabled()
 
 bool GIT::toggleReadOnlyEnabled()
 {
-       return false;
+       return true;
 }