]> 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 535ce1bf3d3c9ff363ed0461a2feb71aeb3c8ebd..4018ef82371d85f22f7b34b20df04921cf2d9b02 100644 (file)
@@ -3,13 +3,12 @@
  * This file is part of LyX, the document processor.
  * Licence details can be found in the file COPYING.
  *
- * \author John Levon 
+ * \author John Levon
  *
  * Full author contact details are available in file CREDITS
  */
 
 #include <config.h>
-#include <fstream>
 
 #ifdef __GNUG__
 #pragma implementation
@@ -18,6 +17,7 @@
 #include "LyXView.h"
 #include "gettext.h"
 #include "ControlLog.h"
+#include "Lsstream.h"
 
 #include <qtextview.h>
 #include <qpushbutton.h>
@@ -26,6 +26,8 @@
 #include "QLog.h"
 #include "Qt2BC.h"
 
+#include <fstream>
+
 using std::ifstream;
 using std::getline;
 
@@ -47,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"));
@@ -65,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());
 }