From 491413211a2f74a4c6b4112356dd6ea9c9484c92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Remko=20Tron=C3=A7on?= <git@el-tramo.be> Date: Fri, 30 Sep 2011 19:23:47 +0200 Subject: Avoid beautifying in console widget. The beautifier is not representing the actual data sent, which is confusing. diff --git a/Swift/QtUI/QtXMLConsoleWidget.cpp b/Swift/QtUI/QtXMLConsoleWidget.cpp index 0c88ce6..e674df8 100644 --- a/Swift/QtUI/QtXMLConsoleWidget.cpp +++ b/Swift/QtUI/QtXMLConsoleWidget.cpp @@ -6,8 +6,6 @@ #include "QtXMLConsoleWidget.h" -#include <Swiften/Client/XMLBeautifier.h> - #include <QCloseEvent> #include <QTextEdit> #include <QVBoxLayout> @@ -51,11 +49,9 @@ QtXMLConsoleWidget::QtXMLConsoleWidget() { setWindowTitle(tr("Debug Console")); emit titleUpdated(); - beautifier = new XMLBeautifier(true, false); } QtXMLConsoleWidget::~QtXMLConsoleWidget() { - delete beautifier; } void QtXMLConsoleWidget::showEvent(QShowEvent* event) { @@ -79,11 +75,11 @@ void QtXMLConsoleWidget::closeEvent(QCloseEvent* event) { } void QtXMLConsoleWidget::handleDataRead(const SafeByteArray& data) { - appendTextIfEnabled(std::string(tr("<!-- IN -->").toUtf8()) + "\n" + beautifier->beautify(safeByteArrayToString(data)) + "\n", QColor(33,98,33)); + appendTextIfEnabled(std::string(tr("<!-- IN -->").toUtf8()) + "\n" + safeByteArrayToString(data) + "\n", QColor(33,98,33)); } void QtXMLConsoleWidget::handleDataWritten(const SafeByteArray& data) { - appendTextIfEnabled(std::string(tr("<!-- OUT -->").toUtf8()) + "\n" + beautifier->beautify(safeByteArrayToString(data)) + "\n", QColor(155,1,0)); + appendTextIfEnabled(std::string(tr("<!-- OUT -->").toUtf8()) + "\n" + safeByteArrayToString(data) + "\n", QColor(155,1,0)); } void QtXMLConsoleWidget::appendTextIfEnabled(const std::string& data, const QColor& color) { diff --git a/Swift/QtUI/QtXMLConsoleWidget.h b/Swift/QtUI/QtXMLConsoleWidget.h index c22251f..912ad90 100644 --- a/Swift/QtUI/QtXMLConsoleWidget.h +++ b/Swift/QtUI/QtXMLConsoleWidget.h @@ -14,8 +14,6 @@ class QCheckBox; class QColor; namespace Swift { - class XMLBeautifier; - class QtXMLConsoleWidget : public QtTabbable, public XMLConsoleWidget { Q_OBJECT @@ -38,6 +36,5 @@ namespace Swift { private: QTextEdit* textEdit; QCheckBox* enabled; - XMLBeautifier* beautifier; }; } -- cgit v0.10.2-6-g49f6