}
-string const & LyXVC::locker() const
+bool LyXVC::locking() const
{
- return vcs->locker();
+ return vcs->status() != VCS::NOLOCKING;
}
std::string const versionString() const;
/**
- * Returns the userid of the person who has locked the doc.
- * 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.
+ * Returns whether we use locking for the given file.
*/
- std::string const & locker() const;
+ bool locking() const;
// type of the revision information
enum RevisionInfo {
void SVN::scanMaster()
{
- locker_.clear();
// vcstatus code is somewhat superflous, until we want
// to implement read-only toggle for svn.
vcstatus = NOLOCKING;
if (checkLockMode()) {
if (isLocked()) {
- locker_ = "Locked";
vcstatus = LOCKED;
} else {
- locker_ = "Unlocked";
vcstatus = UNLOCKED;
}
}
virtual void getLog(support::FileName const &) = 0;
/// return the current version description
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
void owner(Buffer * b) { owner_ = b; }
/// return the owning buffer
/// The status of the VC controlled file.
VCStatus vcstatus;
- /// The user currently keeping the lock on the VC file.
- std::string locker_;
/// The buffer using this VC
Buffer * owner_;
};
* string or if it must be a float/int.
*/
std::string version_;
+ /// The user currently keeping the lock on the VC file (or "Unlocked").
+ std::string locker_;
};
support::FileName file_;
// revision number from scanMaster
std::string version_;
+ /// The user currently keeping the lock on the VC file.
+ std::string locker_;
};
case LFUN_VC_LOCKING_TOGGLE:
enable = doc_buffer && !doc_buffer->isReadonly()
&& doc_buffer->lyxvc().lockingToggleEnabled();
- flag.setOnOff(enable && !doc_buffer->lyxvc().locker().empty());
+ flag.setOnOff(enable && doc_buffer->lyxvc().locking());
break;
case LFUN_VC_REVERT:
enable = doc_buffer && doc_buffer->lyxvc().inUse();
maximize_title = fileName.displayName(30);
minimize_title = from_utf8(fileName.onlyFileName());
if (buf.lyxvc().inUse()) {
- if (buf.lyxvc().locker().empty())
- maximize_title += _(" (version control)");
- else
+ if (buf.lyxvc().locking())
maximize_title += _(" (version control, locking)");
+ else
+ maximize_title += _(" (version control)");
}
if (!buf.isClean()) {
maximize_title += _(" (changed)");