]> git.lyx.org Git - lyx.git/blobdiff - src/LyXVC.cpp
Pimpl MathMacro
[lyx.git] / src / LyXVC.cpp
index 2dd5ac154cc83cd21f1cf23e8f1b1e9b921217cd..4dbcfd2675f5041bda2285e6950f266cc2fee87a 100644 (file)
@@ -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;
@@ -322,12 +323,11 @@ string LyXVC::toggleReadOnly()
        case VCS::LOCKED: {
                LYXERR(Debug::LYXVC, "LyXVC: toggle to unlocked");
                string log;
-               if (checkIn(log) != Success)
+               if (checkIn(log) != VCSuccess)
                        return string();
                return log;
        }
        case VCS::NOLOCKING:
-       case VCS::UNVERSIONED:
                break;
        }
        return string();
@@ -337,7 +337,7 @@ string LyXVC::toggleReadOnly()
 bool LyXVC::inUse() const
 {
        if (vcs)
-               return vcs->status() != VCS::UNVERSIONED;
+               return true;
        return false;
 }
 
@@ -363,7 +363,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();