]> git.lyx.org Git - lyx.git/blobdiff - src/lyxvc.C
Updates from Bennett and myself.
[lyx.git] / src / lyxvc.C
index 607950c46d5246bffbb2efb39dbb917b8ea6db00..73c8452460506bb4a046ea011f5ac522c4211e0c 100644 (file)
 #include "support/filetools.h"
 #include "support/lyxlib.h"
 
-using lyx::support::bformat;
-using lyx::support::isFileReadable;
-using lyx::support::makeDisplayPath;
-using lyx::support::tempName;
 
-using lyx::docstring;
+namespace lyx {
+
+using support::bformat;
+using support::FileName;
+using support::isFileReadable;
+using support::makeAbsPath;
+using support::makeDisplayPath;
+using support::tempName;
 
 using std::endl;
 using std::string;
 using std::pair;
 
-namespace Alert = lyx::frontend::Alert;
+namespace Alert = frontend::Alert;
 
 
 LyXVC::LyXVC()
@@ -93,7 +96,7 @@ void LyXVC::registrer()
        string const filename = owner_->fileName();
 
        // there must be a file to save
-       if (!isFileReadable(filename)) {
+       if (!isFileReadable(FileName(makeAbsPath(filename)))) {
                Alert::error(_("Document not saved"),
                             _("You must save the document "
                                            "before it can be registered."));
@@ -104,17 +107,17 @@ void LyXVC::registrer()
        if (!vcs) {
                string const cvs_entries = "CVS/Entries";
 
-               if (isFileReadable(cvs_entries)) {
+               if (isFileReadable(FileName(makeAbsPath(cvs_entries)))) {
                        lyxerr[Debug::LYXVC]
                                << "LyXVC: registering "
-                               << lyx::to_utf8(makeDisplayPath(filename))
+                               << to_utf8(makeDisplayPath(filename))
                                << " with CVS" << endl;
                        vcs.reset(new CVS(cvs_entries, filename));
 
                } else {
                        lyxerr[Debug::LYXVC]
                                << "LyXVC: registering "
-                               << lyx::to_utf8(makeDisplayPath(filename))
+                               << to_utf8(makeDisplayPath(filename))
                                << " with RCS" << endl;
                        vcs.reset(new RCS(filename));
                }
@@ -132,7 +135,7 @@ void LyXVC::registrer()
                return;
        }
 
-       vcs->registrer(lyx::to_utf8(tmp.second));
+       vcs->registrer(to_utf8(tmp.second));
 }
 
 
@@ -145,7 +148,7 @@ void LyXVC::checkIn()
                if (tmp.second.empty()) {
                        tmp.second = _("(no log message)");
                }
-               vcs->checkIn(lyx::to_utf8(tmp.second));
+               vcs->checkIn(to_utf8(tmp.second));
        } else {
                lyxerr[Debug::LYXVC] << "LyXVC: user cancelled" << endl;
        }
@@ -236,3 +239,6 @@ string const LyXVC::getLogFile() const
        vcs->getLog(tmpf);
        return tmpf;
 }
+
+
+} // namespace lyx