summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemko Tronçon <git@el-tramo.be>2011-09-30 17:23:47 (GMT)
committerRemko Tronçon <git@el-tramo.be>2011-09-30 17:23:47 (GMT)
commit491413211a2f74a4c6b4112356dd6ea9c9484c92 (patch)
tree74054e35fdcd2fef478e14a31294d916f2c5a16a /Swift/QtUI/QtXMLConsoleWidget.cpp
parent75818abb4baa26649baf8d3bf6709aefcda7195f (diff)
downloadswift-contrib-491413211a2f74a4c6b4112356dd6ea9c9484c92.zip
swift-contrib-491413211a2f74a4c6b4112356dd6ea9c9484c92.tar.bz2
Avoid beautifying in console widget.
The beautifier is not representing the actual data sent, which is confusing.
Diffstat (limited to 'Swift/QtUI/QtXMLConsoleWidget.cpp')
-rw-r--r--Swift/QtUI/QtXMLConsoleWidget.cpp8
1 files changed, 2 insertions, 6 deletions
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
@@ -1,19 +1,17 @@
/*
* Copyright (c) 2010 Remko Tronçon
* Licensed under the GNU General Public License v3.
* See Documentation/Licenses/GPLv3.txt for more information.
*/
#include "QtXMLConsoleWidget.h"
-#include <Swiften/Client/XMLBeautifier.h>
-
#include <QCloseEvent>
#include <QTextEdit>
#include <QVBoxLayout>
#include <QPushButton>
#include <QScrollBar>
#include <QCheckBox>
#include "QtSwiftUtil.h"
#include <string>
@@ -45,23 +43,21 @@ QtXMLConsoleWidget::QtXMLConsoleWidget() {
buttonLayout->addStretch();
QPushButton* clearButton = new QPushButton(tr("Clear"), bottom);
connect(clearButton, SIGNAL(clicked()), textEdit, SLOT(clear()));
buttonLayout->addWidget(clearButton);
setWindowTitle(tr("Debug Console"));
emit titleUpdated();
- beautifier = new XMLBeautifier(true, false);
}
QtXMLConsoleWidget::~QtXMLConsoleWidget() {
- delete beautifier;
}
void QtXMLConsoleWidget::showEvent(QShowEvent* event) {
emit windowOpening();
emit titleUpdated(); /* This just needs to be somewhere after construction */
QWidget::showEvent(event);
}
void QtXMLConsoleWidget::show() {
@@ -73,23 +69,23 @@ void QtXMLConsoleWidget::activate() {
emit wantsToActivate();
}
void QtXMLConsoleWidget::closeEvent(QCloseEvent* event) {
emit windowClosing();
event->accept();
}
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) {
if (enabled->isChecked()) {
QScrollBar* scrollBar = textEdit->verticalScrollBar();
bool scrollToBottom = (!scrollBar || scrollBar->value() == scrollBar->maximum());
QTextCursor cursor(textEdit->document());
cursor.beginEditBlock();