1 /* This file is part of
2 * ======================================================
4 * LyX, The Document Processor
6 * Copyright 2001 The LyX Team.
8 * ======================================================
10 * \file ControlVCLog.C
11 * \author John Levon, moz@compsoc.man.ac.uk
12 * \author Angus Leeming <a.leeming@ic.ac.uk>
20 #pragma implementation
24 #include "ButtonControllerBase.h"
25 #include "ControlVCLog.h"
27 #include "BufferView.h"
35 ControlVCLog::ControlVCLog(LyXView & lv, Dialogs & d)
36 : ControlDialog<ControlConnectBD>(lv, d)
38 d_.showVCLogFile.connect(slot(this, &ControlVCLog::show));
41 string const ControlVCLog::getBufferFileName() const
43 return lv_.view()->buffer()->fileName();
47 stringstream & ControlVCLog::getVCLogFile(stringstream & ss) const
49 string const name = lv_.view()->buffer()->lyxvc.getLogFile();
51 std::ifstream in(name.c_str());
53 bool found = (in.get());
56 in.seekg(0, std::ios::beg); // rewind to the beginning
63 ss << "No version control log file found." << endl;