From 4c5ba07a7aa2f00c5b92aa6808f82672f1d313d5 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Fri, 12 Feb 2010 01:44:13 +0000 Subject: [PATCH] Spots from Abdel git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33428 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyXAction.cpp | 2 +- src/LyXVC.cpp | 2 +- src/LyXVC.h | 2 +- src/VCBackend.cpp | 18 +++++++++--------- src/VCBackend.h | 10 +++++----- src/insets/InsetInfo.cpp | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 673a2308cf..8cdc26803f 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -415,7 +415,7 @@ void LyXAction::init() textclass: name of textclass (e.g. article) \n menu: name of lfun used in menu \n icon: name of lfun used in toolbar \n - buffer: "name"|"path"|"class" + buffer: "name"|"path"|"class"|"vcs-revision" * \li Sample: command-sequence info-insert buffer path; info-insert buffer name * \li Origin: bpeng, 7 Oct 2007 * \endvar diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index b33459a0da..1c08863f1e 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -287,7 +287,7 @@ string const LyXVC::getLogFile() const } -std::string const LyXVC::revisionInfo(RevisionInfo const info) +std::string LyXVC::revisionInfo(RevisionInfo const info) { if (!vcs) return string(); diff --git a/src/LyXVC.h b/src/LyXVC.h index f3e591fa03..6a4b3bd0a6 100644 --- a/src/LyXVC.h +++ b/src/LyXVC.h @@ -153,7 +153,7 @@ public: * Its safe to call it regardless VCS is in usage or this * info is (un)available. Returns empty string in such a case. */ - std::string const revisionInfo(RevisionInfo const info); + std::string revisionInfo(RevisionInfo const info); private: /// diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp index 9a8dc7e39c..908593b967 100644 --- a/src/VCBackend.cpp +++ b/src/VCBackend.cpp @@ -281,7 +281,7 @@ bool RCS::toggleReadOnlyEnabled() } // FIXME This could be implemented with cache from scanMaster -string const RCS::revisionInfo(LyXVC::RevisionInfo const) +string RCS::revisionInfo(LyXVC::RevisionInfo const) { return string(); } @@ -482,7 +482,7 @@ bool CVS::toggleReadOnlyEnabled() } -string const CVS::revisionInfo(LyXVC::RevisionInfo const) +string CVS::revisionInfo(LyXVC::RevisionInfo const) { return string(); } @@ -857,18 +857,18 @@ bool SVN::undoLastEnabled() } -string const SVN::revisionInfo(LyXVC::RevisionInfo const info) +string SVN::revisionInfo(LyXVC::RevisionInfo const info) { switch (info) { case LyXVC::File: - if (_rev_file_cache.empty()) - _rev_file_cache = getFileRevisionInfo(); - if (_rev_file_cache.empty()) - _rev_file_cache = "?"; - if (_rev_file_cache == "?") + if (rev_file_cache_.empty()) + rev_file_cache_ = getFileRevisionInfo(); + if (rev_file_cache_.empty()) + rev_file_cache_ = "?"; + if (rev_file_cache_ == "?") return string(); - return _rev_file_cache; + return rev_file_cache_; } return string(); } diff --git a/src/VCBackend.h b/src/VCBackend.h index c14ba17754..43b2e1d2ea 100644 --- a/src/VCBackend.h +++ b/src/VCBackend.h @@ -80,7 +80,7 @@ public: /// (also used for check-out operation) virtual bool toggleReadOnlyEnabled() = 0; /// Return revision info specified by the argument. - virtual std::string const revisionInfo(LyXVC::RevisionInfo const info) = 0; + virtual std::string revisionInfo(LyXVC::RevisionInfo const info) = 0; protected: /// parse information from the version file virtual void scanMaster() = 0; @@ -161,7 +161,7 @@ public: virtual bool toggleReadOnlyEnabled(); - virtual std::string const revisionInfo(LyXVC::RevisionInfo const info); + virtual std::string revisionInfo(LyXVC::RevisionInfo const info); protected: virtual void scanMaster(); @@ -210,7 +210,7 @@ public: virtual bool toggleReadOnlyEnabled(); - virtual std::string const revisionInfo(LyXVC::RevisionInfo const info); + virtual std::string revisionInfo(LyXVC::RevisionInfo const info); protected: virtual void scanMaster(); @@ -262,7 +262,7 @@ public: virtual bool toggleReadOnlyEnabled(); - virtual std::string const revisionInfo(LyXVC::RevisionInfo const info); + virtual std::string revisionInfo(LyXVC::RevisionInfo const info); protected: virtual void scanMaster(); @@ -282,7 +282,7 @@ private: /// real code for obtaining file revision info std::string getFileRevisionInfo(); /// cache for file revision number, "?" if already unsuccessful - std::string _rev_file_cache; + std::string rev_file_cache_; }; } // namespace lyx diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 0df2fd5941..871a361d49 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -175,7 +175,7 @@ bool InsetInfo::validateModifyArgument(docstring const & arg) const return true; case BUFFER_INFO: return name == "name" || name == "path" || name == "class" || - name == "file-revision"; + name == "vcs-revision"; } return false; } @@ -373,7 +373,7 @@ void InsetInfo::updateInfo() setText(from_utf8(buffer().filePath())); else if (name_ == "class") setText(from_utf8(bp.documentClass().name())); - else if (name_ == "file-revision" && buffer().lyxvc().inUse() && + else if (name_ == "vcs-revision" && buffer().lyxvc().inUse() && !buffer().lyxvc().revisionInfo(LyXVC::File).empty()) setText(from_utf8(buffer().lyxvc().revisionInfo(LyXVC::File))); else -- 2.39.2