]> git.lyx.org Git - lyx.git/blobdiff - src/vc-backend.C
last Friday's text*.C -> text_func shuffle
[lyx.git] / src / vc-backend.C
index 8a9fa6bd2a21482b30848daa90014b33d93f7ce3..5c3e6f3731074ba2f3d9c3a5f4a873d9fdb63c7a 100644 (file)
@@ -1,9 +1,5 @@
 #include <config.h>
 
-#ifdef __GNUG__
-#pragma implementation
-#endif
-
 #include "vc-backend.h"
 #include "debug.h"
 #include "buffer.h"
@@ -21,6 +17,8 @@
 
 #include <fstream>
 
+using namespace lyx::support;
+
 #ifndef CXX_GLOBAL_CSTD
 using std::asctime;
 using std::gmtime;
@@ -49,6 +47,15 @@ int VCS::doVCCommand(string const & cmd, string const & path)
 }
 
 
+void VCS::reload()
+{
+       owner_->getUser()->reload();
+       /* Watch out ! We have deleted ourselves here
+        * via the ->reload() !
+        */
+}
+
+
 RCS::RCS(string const & m)
 {
        master_ = m;
@@ -165,7 +172,7 @@ void RCS::registrer(string const & msg)
        cmd += OnlyFilename(owner_->fileName());
        cmd += '"';
        doVCCommand(cmd, owner_->filePath());
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }
 
 
@@ -174,7 +181,7 @@ void RCS::checkIn(string const & msg)
        doVCCommand("ci -q -u -m\"" + msg + "\" \""
                    + OnlyFilename(owner_->fileName()) + '"',
                    owner_->filePath());
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }
 
 
@@ -184,7 +191,7 @@ void RCS::checkOut()
        doVCCommand("co -q -l \""
                    + OnlyFilename(owner_->fileName()) + '"',
                    owner_->filePath());
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }
 
 
@@ -195,7 +202,7 @@ void RCS::revert()
                    owner_->filePath());
        // We ignore changes and just reload!
        owner_->markClean();
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }
 
 
@@ -304,7 +311,7 @@ void CVS::registrer(string const & msg)
        doVCCommand("cvs -q add -m \"" + msg + "\" \""
                    + OnlyFilename(owner_->fileName()) + '"',
                    owner_->filePath());
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }
 
 
@@ -313,7 +320,7 @@ void CVS::checkIn(string const & msg)
        doVCCommand("cvs -q commit -m \"" + msg + "\" \""
                    + OnlyFilename(owner_->fileName()) + '"',
                    owner_->filePath());
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }
 
 
@@ -333,7 +340,7 @@ void CVS::revert()
        doVCCommand("rm -f \"" + fil + "\"; cvs update \"" + fil + '"',
                    owner_->filePath());
        owner_->markClean();
-       owner_->getUser()->owner()->dispatch(FuncRequest(LFUN_MENURELOAD));
+       reload();
 }