Git commit d07d09757b0e813c2b6e83ea3059f1ba9cf5a1b0 by Jan Kundr?t. Committed on 15/11/2012 at 15:08. Pushed by jkt into branch 'master'.
GUI: when clearing the logs, remove the contents as well as the actual tabs M +12 -2 src/Gui/ProtocolLoggerWidget.cpp http://commits.kde.org/trojita/d07d09757b0e813c2b6e83ea3059f1ba9cf5a1b0 diff --git a/src/Gui/ProtocolLoggerWidget.cpp b/src/Gui/ProtocolLoggerWidget.cpp index 156dd5e..9e78667 100644 --- a/src/Gui/ProtocolLoggerWidget.cpp +++ b/src/Gui/ProtocolLoggerWidget.cpp @@ -116,9 +116,19 @@ void ProtocolLoggerWidget::closeTab(int index) void ProtocolLoggerWidget::clearLogDisplay() { - for (QMap<uint, QPlainTextEdit *>::iterator it = loggerWidgets.begin(); it != loggerWidgets.end(); ++it) { - (*it)->document()->clear(); + // These will be freed from the GUI + loggerWidgets.clear(); + + // We use very different indexing internally, to an extent where QTabWidget's ints are not easily obtainable from that, + // so it's much better to clean up the GUI at first and only after that purge the underlying data + while (tabs->count()) { + QWidget *w = tabs->widget(0); + Q_ASSERT(w); + tabs->removeTab(0); + w->deleteLater(); } + + buffers.clear(); } void ProtocolLoggerWidget::showEvent(QShowEvent *e)
