- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QDebugStream.hpp
r4d6d6a r52dfcc 33 33 { 34 34 public: 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) 36 38 { 37 39 log_window = text_edit; … … 54 56 { 55 57 if (v == '\n') { 58 while (printing); 59 printing = true; 56 60 log_window->append(m_string.c_str()); 57 61 qDebug() << m_string.c_str(); 58 62 m_string.erase(m_string.begin(), m_string.end()); 63 printing = false; 59 64 } else 60 65 m_string += v; … … 65 70 virtual std::streamsize xsputn(const char *p, std::streamsize n) 66 71 { 72 while (printing); 73 printing = true; 67 74 m_string.append(p, p + n); 75 printing = false; 68 76 69 77 size_t pos = 0; … … 72 80 if (pos != std::string::npos) { 73 81 std::string tmp(m_string.begin(), m_string.begin() + pos); 82 while (printing); 83 printing = true; 74 84 log_window->append(tmp.c_str()); 75 85 qDebug() << tmp.c_str(); 76 86 m_string.erase(m_string.begin(), m_string.begin() + pos + 1); 87 printing = false; 77 88 } 78 89 } … … 86 97 std::string m_string; 87 98 99 bool printing; 100 88 101 QTextEdit* log_window; 89 102 };
Note:
See TracChangeset
for help on using the changeset viewer.