]> git.lyx.org Git - features.git/commitdiff
toggleReadOnly belongs only to RCS, not CVS.
authorPavel Sanda <sanda@lyx.org>
Tue, 22 Jul 2008 09:00:05 +0000 (09:00 +0000)
committerPavel Sanda <sanda@lyx.org>
Tue, 22 Jul 2008 09:00:05 +0000 (09:00 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25787 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXVC.cpp
src/VCBackend.cpp
src/VCBackend.h

index 1ed30fe66376da1d2348ef1916c9154b41817f0a..808ae2b50f216ba6fb28e44eac446e950e11f012 100644 (file)
@@ -188,6 +188,9 @@ void LyXVC::undoLast()
 
 void LyXVC::toggleReadOnly()
 {
+       if (!vcs->toggleReadOnlyEnabled())
+               return;
+
        switch (vcs->status()) {
        case VCS::UNLOCKED:
                LYXERR(Debug::LYXVC, "LyXVC: toggle to locked");
index b8e4e4b0a8095b5018489dd9eee59797802a4e81..829b291ca6124e252dfbf0496540bb8ba43dc627 100644 (file)
@@ -223,6 +223,12 @@ void RCS::getLog(FileName const & tmpf)
 }
 
 
+bool RCS::toggleReadOnlyEnabled()
+{
+       return true;
+}
+
+
 /////////////////////////////////////////////////////////////////////
 //
 // CVS
@@ -381,6 +387,10 @@ void CVS::getLog(FileName const & tmpf)
                    FileName(owner_->filePath()));
 }
 
+bool CVS::toggleReadOnlyEnabled()
+{
+       return false;
+}
 
 /////////////////////////////////////////////////////////////////////
 //
@@ -454,9 +464,6 @@ bool SVN::checkInEnabled()
 
 void SVN::checkOut()
 {
-       // svn update or perhaps for svn this should be a noop
-       // we need to detect conflict (eg "C" in output)
-       // before we can do this.
        lyxerr << "Sorry not implemented." << endl;
 }
 
@@ -502,5 +509,10 @@ void SVN::getLog(FileName const & tmpf)
 }
 
 
+bool SVN::toggleReadOnlyEnabled()
+{
+       return false;
+}
+
 
 } // namespace lyx
index ad441c60816edade7d1436d12bb43f7b471ce6ca..402a723399aa84de3608cc479e6c89dd4a732fcf 100644 (file)
@@ -65,6 +65,8 @@ public:
        Buffer * owner() const { return owner_; }
        /// return the lock status of this file
        VCStatus status() const { return vcstatus; }
+       /// do we need special handling for read-only toggling?
+       virtual bool toggleReadOnlyEnabled() = 0;
 protected:
        /// parse information from the version file
        virtual void scanMaster() = 0;
@@ -133,6 +135,8 @@ public:
                return "RCS: " + version_;
        }
 
+       virtual bool toggleReadOnlyEnabled();
+
 protected:
        virtual void scanMaster();
 };
@@ -170,6 +174,8 @@ public:
                return "CVS: " + version_;
        }
 
+       virtual bool toggleReadOnlyEnabled();
+
 protected:
        virtual void scanMaster();
 
@@ -210,6 +216,8 @@ public:
                return "SVN: " + version_;
        }
 
+       virtual bool toggleReadOnlyEnabled();
+
 protected:
        virtual void scanMaster();