#include "support/filetools.h"
#include "support/gettext.h"
#include "support/lstrings.h"
+#include "support/TempFile.h"
using namespace std;
using namespace lyx::support;
return log;
}
case VCS::NOLOCKING:
- case VCS::UNVERSIONED:
- 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();
}
bool LyXVC::inUse() const
{
if (vcs)
- return vcs->status() != VCS::UNVERSIONED;
+ return true;
return false;
}
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();