toggleReadOnly belongs only to RCS, not CVS.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25787 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2008-07-22 09:00:05 +00:00
parent 0129d2fad1
commit 38edfeb537
3 changed files with 26 additions and 3 deletions

View File

@ -188,6 +188,9 @@ void LyXVC::undoLast()
void LyXVC::toggleReadOnly() void LyXVC::toggleReadOnly()
{ {
if (!vcs->toggleReadOnlyEnabled())
return;
switch (vcs->status()) { switch (vcs->status()) {
case VCS::UNLOCKED: case VCS::UNLOCKED:
LYXERR(Debug::LYXVC, "LyXVC: toggle to locked"); LYXERR(Debug::LYXVC, "LyXVC: toggle to locked");

View File

@ -223,6 +223,12 @@ void RCS::getLog(FileName const & tmpf)
} }
bool RCS::toggleReadOnlyEnabled()
{
return true;
}
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// //
// CVS // CVS
@ -381,6 +387,10 @@ void CVS::getLog(FileName const & tmpf)
FileName(owner_->filePath())); FileName(owner_->filePath()));
} }
bool CVS::toggleReadOnlyEnabled()
{
return false;
}
///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////
// //
@ -454,9 +464,6 @@ bool SVN::checkInEnabled()
void SVN::checkOut() 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; lyxerr << "Sorry not implemented." << endl;
} }
@ -502,5 +509,10 @@ void SVN::getLog(FileName const & tmpf)
} }
bool SVN::toggleReadOnlyEnabled()
{
return false;
}
} // namespace lyx } // namespace lyx

View File

@ -65,6 +65,8 @@ public:
Buffer * owner() const { return owner_; } Buffer * owner() const { return owner_; }
/// return the lock status of this file /// return the lock status of this file
VCStatus status() const { return vcstatus; } VCStatus status() const { return vcstatus; }
/// do we need special handling for read-only toggling?
virtual bool toggleReadOnlyEnabled() = 0;
protected: protected:
/// parse information from the version file /// parse information from the version file
virtual void scanMaster() = 0; virtual void scanMaster() = 0;
@ -133,6 +135,8 @@ public:
return "RCS: " + version_; return "RCS: " + version_;
} }
virtual bool toggleReadOnlyEnabled();
protected: protected:
virtual void scanMaster(); virtual void scanMaster();
}; };
@ -170,6 +174,8 @@ public:
return "CVS: " + version_; return "CVS: " + version_;
} }
virtual bool toggleReadOnlyEnabled();
protected: protected:
virtual void scanMaster(); virtual void scanMaster();
@ -210,6 +216,8 @@ public:
return "SVN: " + version_; return "SVN: " + version_;
} }
virtual bool toggleReadOnlyEnabled();
protected: protected:
virtual void scanMaster(); virtual void scanMaster();