]> git.lyx.org Git - features.git/blobdiff - src/frontends/qt2/QLog.C
change "support/std_sstream.h" to <sstream>
[features.git] / src / frontends / qt2 / QLog.C
index cb03fde8c6133bc9e18cfb4a3ff2a5b06988d6b1..4bc69419a23cff4d28e715e3d3ac990f9ba0ce2b 100644 (file)
 
 #include <config.h>
 
-
+#include "QLog.h"
+#include "QLogDialog.h"
 #include "qt_helpers.h"
-#include "ControlLog.h"
-#include "support/std_sstream.h"
 
-#include <qtextview.h>
-#include <qpushbutton.h>
+#include "controllers/ControlLog.h"
 
-#include "QLogDialog.h"
-#include "QLog.h"
-#include "Qt2BC.h"
+#include <sstream>
 
-#include <fstream>
+#include <qtextview.h>
+#include <qpushbutton.h>
 
-using std::ifstream;
-using std::getline;
-using std::ostringstream;
+namespace lyx {
+namespace frontend {
 
 typedef QController<ControlLog, QView<QLogDialog> > base_class;
 
 QLog::QLog(Dialog & parent)
-       : base_class(parent, _("LyX: LaTeX Log"))
-{
-}
+       : base_class(parent, "")
+{}
 
 
 void QLog::build_dialog()
 {
        dialog_.reset(new QLogDialog(this));
-
-       bcview().setCancel(dialog_->closePB);
 }
 
 
 void QLog::update_contents()
 {
-       std::pair<Buffer::LogType, string> const & logfile =
-               controller().logfile();
+       setTitle(controller().title());
 
-       if (logfile.first == Buffer::buildlog)
-               setTitle(_("Build log"));
-       else
-               setTitle(_("LaTeX log"));
+       std::ostringstream ss;
+       controller().getContents(ss);
 
-       dialog_->logTV->setText("");
-
-       ifstream ifstr(logfile.second.c_str());
-       if (!ifstr) {
-               if (logfile.first == Buffer::buildlog)
-                       dialog_->logTV->setText(qt_("No build log file found."));
-               else
-                       dialog_->logTV->setText(qt_("No LaTeX log file found."));
-               return;
-       }
-
-       ostringstream ost;
-       ost << ifstr.rdbuf();
-
-       dialog_->logTV->setText(toqstr(ost.str()));
+       dialog_->logTV->setText(toqstr(ss.str()));
 }
+
+} // namespace frontend
+} // namespace lyx