X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXVC.cpp;h=b28139fb61c08d124220acde13dd986f42c324f7;hb=57b69a5efddf9f3c148007322f00dad6c253a2ed;hp=fb6e8224266e7e6a81b9019b897b219b079e727e;hpb=ceb2303e2b9dbdd09798e5536ce16067e6d76e90;p=lyx.git diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index fb6e822426..b28139fb61 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -25,6 +25,7 @@ #include "support/filetools.h" #include "support/gettext.h" #include "support/lstrings.h" +#include "support/TempFile.h" using namespace std; using namespace lyx::support; @@ -40,11 +41,6 @@ LyXVC::LyXVC() } -// for the sake of boost::scoped_ptr -LyXVC::~LyXVC() -{} - - bool LyXVC::fileInVC(FileName const & fn) { if (!RCS::findFile(fn).empty()) @@ -327,7 +323,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(); } @@ -362,7 +364,9 @@ string const LyXVC::getLogFile() const if (!vcs) return string(); - FileName const tmpf = FileName::tempName("lyxvclog"); + TempFile tempfile("lyxvclog"); + tempfile.setAutoRemove(false); + FileName const tmpf = tempfile.name(); if (tmpf.empty()) { LYXERR(Debug::LYXVC, "Could not generate logfile " << tmpf); return string();