Kill locker() API in VCS

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33438 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2010-02-12 07:21:11 +00:00
parent 495daad277
commit f26f990076
6 changed files with 12 additions and 24 deletions

View File

@ -259,9 +259,9 @@ string const LyXVC::versionString() const
} }
string const & LyXVC::locker() const bool LyXVC::locking() const
{ {
return vcs->locker(); return vcs->status() != VCS::NOLOCKING;
} }

View File

@ -127,18 +127,9 @@ public:
std::string const versionString() const; std::string const versionString() const;
/** /**
* Returns the userid of the person who has locked the doc. * Returns whether we use locking for the given file.
* FIXME This property is descendant from the original VCS
* and used in RCS for user id or "unlocked" strings.
* It would be problem to use this under SVN since getting
* the locker would need connection to server any time we
* load document. SVN currently (mis)uses this as a signal
* for locking state, as we do not have API for vcstatus().
* The RCS code for user id parsing is working but we don't display
* it anywhere. One possibility is to provide proper vcstatus()
* interface and kill the whole locker thing.
*/ */
std::string const & locker() const; bool locking() const;
// type of the revision information // type of the revision information
enum RevisionInfo { enum RevisionInfo {

View File

@ -536,16 +536,13 @@ FileName const SVN::findFile(FileName const & file)
void SVN::scanMaster() void SVN::scanMaster()
{ {
locker_.clear();
// vcstatus code is somewhat superflous, until we want // vcstatus code is somewhat superflous, until we want
// to implement read-only toggle for svn. // to implement read-only toggle for svn.
vcstatus = NOLOCKING; vcstatus = NOLOCKING;
if (checkLockMode()) { if (checkLockMode()) {
if (isLocked()) { if (isLocked()) {
locker_ = "Locked";
vcstatus = LOCKED; vcstatus = LOCKED;
} else { } else {
locker_ = "Unlocked";
vcstatus = UNLOCKED; vcstatus = UNLOCKED;
} }
} }

View File

@ -67,8 +67,6 @@ public:
virtual void getLog(support::FileName const &) = 0; virtual void getLog(support::FileName const &) = 0;
/// return the current version description /// return the current version description
virtual std::string const versionString() const = 0; virtual std::string const versionString() const = 0;
/// return the user who has locked the file
std::string const & locker() const { return locker_; }
/// set the owning buffer /// set the owning buffer
void owner(Buffer * b) { owner_ = b; } void owner(Buffer * b) { owner_ = b; }
/// return the owning buffer /// return the owning buffer
@ -103,8 +101,6 @@ protected:
/// The status of the VC controlled file. /// The status of the VC controlled file.
VCStatus vcstatus; VCStatus vcstatus;
/// The user currently keeping the lock on the VC file.
std::string locker_;
/// The buffer using this VC /// The buffer using this VC
Buffer * owner_; Buffer * owner_;
}; };
@ -164,6 +160,8 @@ private:
* string or if it must be a float/int. * string or if it must be a float/int.
*/ */
std::string version_; std::string version_;
/// The user currently keeping the lock on the VC file (or "Unlocked").
std::string locker_;
}; };
@ -218,6 +216,8 @@ private:
support::FileName file_; support::FileName file_;
// revision number from scanMaster // revision number from scanMaster
std::string version_; std::string version_;
/// The user currently keeping the lock on the VC file.
std::string locker_;
}; };

View File

@ -1583,7 +1583,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
case LFUN_VC_LOCKING_TOGGLE: case LFUN_VC_LOCKING_TOGGLE:
enable = doc_buffer && !doc_buffer->isReadonly() enable = doc_buffer && !doc_buffer->isReadonly()
&& doc_buffer->lyxvc().lockingToggleEnabled(); && doc_buffer->lyxvc().lockingToggleEnabled();
flag.setOnOff(enable && !doc_buffer->lyxvc().locker().empty()); flag.setOnOff(enable && doc_buffer->lyxvc().locking());
break; break;
case LFUN_VC_REVERT: case LFUN_VC_REVERT:
enable = doc_buffer && doc_buffer->lyxvc().inUse(); enable = doc_buffer && doc_buffer->lyxvc().inUse();

View File

@ -1192,10 +1192,10 @@ void GuiWorkArea::updateWindowTitle()
maximize_title = fileName.displayName(30); maximize_title = fileName.displayName(30);
minimize_title = from_utf8(fileName.onlyFileName()); minimize_title = from_utf8(fileName.onlyFileName());
if (buf.lyxvc().inUse()) { if (buf.lyxvc().inUse()) {
if (buf.lyxvc().locker().empty()) if (buf.lyxvc().locking())
maximize_title += _(" (version control)");
else
maximize_title += _(" (version control, locking)"); maximize_title += _(" (version control, locking)");
else
maximize_title += _(" (version control)");
} }
if (!buf.isClean()) { if (!buf.isClean()) {
maximize_title += _(" (changed)"); maximize_title += _(" (changed)");