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