]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QLog.C
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QLog.C
index 7759a52fe053225de69644c2d4f01aca574ef927..4018ef82371d85f22f7b34b20df04921cf2d9b02 100644 (file)
@@ -1,36 +1,40 @@
 /**
  * \file QLog.C
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author John Levon <moz@compsoc.man.ac.uk>
+ * \author John Levon
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
-#include <fstream>
 
 #ifdef __GNUG__
 #pragma implementation
 #endif
 
+#include "LyXView.h"
+#include "gettext.h"
+#include "ControlLog.h"
+#include "Lsstream.h"
+
 #include <qtextview.h>
 #include <qpushbutton.h>
 
 #include "QLogDialog.h"
 #include "QLog.h"
 #include "Qt2BC.h"
-#include "gettext.h"
 
-#include "QtLyXView.h"
-#include "ControlLog.h"
+#include <fstream>
 
 using std::ifstream;
 using std::getline;
 
 typedef Qt2CB<ControlLog, Qt2DB<QLogDialog> > base_class;
 
-QLog::QLog(ControlLog & c)
-       : base_class(c, _("Log"))
+QLog::QLog()
+       : base_class(_("Log"))
 {
 }
 
@@ -45,7 +49,8 @@ void QLog::build_dialog()
 
 void QLog::update_contents()
 {
-       std::pair<Buffer::LogType, string> const logfile = controller().logfile();
+       std::pair<Buffer::LogType, string> const & logfile =
+               controller().logfile();
 
        if (logfile.first == Buffer::buildlog)
                dialog_->setCaption(_("Build log"));
@@ -63,11 +68,8 @@ void QLog::update_contents()
                return;
        }
 
-       string text;
-       string line;
-
-       while (getline(ifstr, line))
-               text += line + "\n";
+       ostringstream ost;
+       ost << ifstr.rdbuf();
 
-       dialog_->logTV->setText(text.c_str());
+       dialog_->logTV->setText(ost.str().c_str());
 }