X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FLyXVC.cpp;h=7e36a1ce9cf0438841432df971bed3d6092f6d95;hb=4ea841fe24ec0f171577b3125425b74afdd0f28a;hp=1572a036d24e8c331142713650f7e049c4304f8a;hpb=6cb05ce8bb58720dfef6e5707c1f3fad3949881f;p=lyx.git diff --git a/src/LyXVC.cpp b/src/LyXVC.cpp index 1572a036d2..7e36a1ce9c 100644 --- a/src/LyXVC.cpp +++ b/src/LyXVC.cpp @@ -37,7 +37,7 @@ namespace Alert = frontend::Alert; LyXVC::LyXVC() { - owner_ = 0; + owner_ = nullptr; } @@ -45,10 +45,10 @@ docstring LyXVC::vcstatus() const { if (!vcs) return docstring(); - if (locking()) - return bformat(_("%1$s lock"), from_ascii(vcs->vcname())); - else - return from_ascii(vcs->vcname()); + if (locking()) + return bformat(_("%1$s lock"), from_ascii(vcs->vcname())); + else + return from_ascii(vcs->vcname()); } @@ -91,7 +91,7 @@ bool LyXVC::file_found_hook(FileName const & fn) } // file is not under any VCS. - vcs.reset(0); + vcs.reset(nullptr); return false; } @@ -186,7 +186,7 @@ bool LyXVC::registrer() _("(no initial description)")); if (!ok) { LYXERR(Debug::LYXVC, "LyXVC: user cancelled"); - vcs.reset(0); + vcs.reset(nullptr); return false; } if (response.empty()) @@ -262,7 +262,7 @@ string LyXVC::checkOut() if (!vcs) return string(); //RCS allows checkOut only in ReadOnly mode - if (vcs->toggleReadOnlyEnabled() && !owner_->isReadonly()) + if (vcs->toggleReadOnlyEnabled() && !owner_->hasReadonlyFlag()) return string(); LYXERR(Debug::LYXVC, "LyXVC: checkOut"); @@ -335,7 +335,7 @@ string LyXVC::toggleReadOnly() } case VCS::NOLOCKING: Buffer * b = vcs->owner(); - bool const newstate = !b->isReadonly(); + bool const newstate = !b->hasReadonlyFlag(); string result = "LyXVC: toggle to "; result += (newstate ? "readonly" : "readwrite"); LYXERR(Debug::LYXVC, result); @@ -348,9 +348,7 @@ string LyXVC::toggleReadOnly() bool LyXVC::inUse() const { - if (vcs) - return true; - return false; + return vcs != nullptr; } @@ -447,8 +445,8 @@ bool LyXVC::repoUpdateEnabled() const { return vcs && vcs->repoUpdateEnabled(); } - - + + bool LyXVC::prepareFileRevision(string const & rev, std::string & f) { return vcs && vcs->prepareFileRevision(rev, f);