]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlVCLog.C
Re-add the RasterImage template.
[lyx.git] / src / frontends / controllers / ControlVCLog.C
1 /**
2  * \file ControlVCLog.C
3  * This file is part of LyX, the document processor.
4  * Licence details can be found in the file COPYING.
5  *
6  * \author John Levon
7  * \author Angus Leeming
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #include <config.h>
13
14 #include "ControlVCLog.h"
15 #include "buffer.h"
16 #include "gettext.h"
17 #include "lyxvc.h"
18 #include "support/lyxlib.h"
19 #include <fstream>
20
21 using lyx::support::unlink;
22
23 using std::endl;
24 using std::ostream;
25
26
27 ControlVCLog::ControlVCLog(Dialog & parent)
28         : Dialog::Controller(parent)
29 {}
30
31
32 string const ControlVCLog::getBufferFileName() const
33 {
34         return kernel().buffer().fileName();
35 }
36
37
38 void ControlVCLog::getVCLogFile(ostream & ss) const
39 {
40         string const name = kernel().buffer().lyxvc().getLogFile();
41
42         std::ifstream in(name.c_str());
43
44         bool found(false);
45
46         if (in) {
47                 ss << in.rdbuf();
48                 found = ss.good();
49         }
50
51         if (!found)
52                 ss << _("No version control log file found.") << endl;
53
54         unlink(name);
55 }