From 38edfeb537ef7b127aee1ae333f0cfe2be4e1a5d Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Tue, 22 Jul 2008 09:00:05 +0000 Subject: [PATCH] toggleReadOnly belongs only to RCS, not CVS. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25787 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyXVC.cpp | 3 +++ src/VCBackend.cpp | 18 +++++++++++++++--- src/VCBackend.h | 8 ++++++++ 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index 1ed30fe663..808ae2b50f 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -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"); diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp index b8e4e4b0a8..829b291ca6 100644 --- a/src/VCBackend.cpp +++ b/src/VCBackend.cpp @@ -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 diff --git a/src/VCBackend.h b/src/VCBackend.h index ad441c6081..402a723399 100644 --- a/src/VCBackend.h +++ b/src/VCBackend.h @@ -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();