]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlVCLog.C
Add a buffer_path arg to InsetGraphicsMailer's params2string, string2params.
[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 "support/lyxlib.h"
18 #include <fstream>
19
20 using namespace lyx::support;
21
22 using std::endl;
23 using std::ostream;
24
25
26 ControlVCLog::ControlVCLog(Dialog & parent)
27         : Dialog::Controller(parent)
28 {}
29
30
31 string const ControlVCLog::getBufferFileName() const
32 {
33         return kernel().buffer()->fileName();
34 }
35
36
37 void ControlVCLog::getVCLogFile(ostream & ss) const
38 {
39         string const name = kernel().buffer()->lyxvc.getLogFile();
40
41         std::ifstream in(name.c_str());
42
43         bool found(false);
44
45         if (in) {
46                 ss << in.rdbuf();
47                 found = ss.good();
48         }
49
50         if (!found)
51                 ss << _("No version control log file found.") << endl;
52
53         unlink(name);
54 }