Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QDebugStream.hpp

    r4d6d6a r52dfcc  
    3333{
    3434public:
    35   QDebugStream(std::ostream &stream, QTextEdit* text_edit) : m_stream(stream)
     35  QDebugStream(std::ostream &stream, QTextEdit* text_edit) :
     36    m_stream(stream),
     37    printing(false)
    3638  {
    3739    log_window = text_edit;
     
    5456  {
    5557    if (v == '\n') {
     58      while (printing);
     59      printing = true;
    5660      log_window->append(m_string.c_str());
    5761      qDebug() << m_string.c_str();
    5862      m_string.erase(m_string.begin(), m_string.end());
     63      printing = false;
    5964    } else
    6065      m_string += v;
     
    6570  virtual std::streamsize xsputn(const char *p, std::streamsize n)
    6671  {
     72    while (printing);
     73    printing = true;
    6774    m_string.append(p, p + n);
     75    printing = false;
    6876
    6977    size_t pos = 0;
     
    7280      if (pos != std::string::npos) {
    7381        std::string tmp(m_string.begin(), m_string.begin() + pos);
     82        while (printing);
     83        printing = true;
    7484        log_window->append(tmp.c_str());
    7585        qDebug() << tmp.c_str();
    7686        m_string.erase(m_string.begin(), m_string.begin() + pos + 1);
     87        printing = false;
    7788      }
    7889    }
     
    8697  std::string m_string;
    8798
     99  bool printing;
     100
    88101  QTextEdit* log_window;
    89102};
Note: See TracChangeset for help on using the changeset viewer.