]> git.lyx.org Git - lyx.git/commitdiff
Kill locker() API in VCS
authorPavel Sanda <sanda@lyx.org>
Fri, 12 Feb 2010 07:21:11 +0000 (07:21 +0000)
committerPavel Sanda <sanda@lyx.org>
Fri, 12 Feb 2010 07:21:11 +0000 (07:21 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33438 a592a061-630c-0410-9148-cb99ea01b6c8

src/LyXVC.cpp
src/LyXVC.h
src/VCBackend.cpp
src/VCBackend.h
src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiWorkArea.cpp

index 173756f9e7a14b2c2ca5713d5208ff3b11eb258f..c66ce169b0fd9b6af9eee2a20e6fb4700195508d 100644 (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;
 }
 
 
index b4cef3c910a6ae1393d90c106258daacea8fc0f6..92db82c52c1571d7f33e03e7cc5ab43b00a5e3f9 100644 (file)
@@ -127,18 +127,9 @@ public:
        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 {
index dd3aa9b9cf6af7c5373ca33d93c1b1db547bf48d..e10ea872d3193c125b33ca288b2797edbdfca269 100644 (file)
@@ -536,16 +536,13 @@ FileName const SVN::findFile(FileName const & file)
 
 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;
                }
        }
index c43846ed5ab659cf09ee635a03d309437bb3b06f..7a277edcc6393f76dc4003334e3269c017e5bf97 100644 (file)
@@ -67,8 +67,6 @@ public:
        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
@@ -103,8 +101,6 @@ protected:
        /// 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_;
 };
@@ -164,6 +160,8 @@ private:
         * 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_;
 };
 
 
@@ -218,6 +216,8 @@ private:
        support::FileName file_;
        // revision number from scanMaster
        std::string version_;
+       /// The user currently keeping the lock on the VC file.
+       std::string locker_;
 };
 
 
index 5b3b72d6bc4fd7f45cc61ebc0590e73fe2a20c73..d6c2e51bddafb213149185a809a894cc086bf4c6 100644 (file)
@@ -1583,7 +1583,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
        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();
index ab6aafff7a3f01253cf07f60ef72d1a349bd46e5..1ab194b03905ad28a56e97535fc7a065af35ac02 100644 (file)
@@ -1192,10 +1192,10 @@ void GuiWorkArea::updateWindowTitle()
                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)");