From: Christoph Egger Date: Mon, 25 May 2015 04:28:32 +0000 (+0200) Subject: Fix formating of comments. Should not start with a linebreak X-Git-Tag: v0.2~16 X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=commitdiff_plain;h=9d118e5302db0c9aefe6b0e662795aef6f7b71a1 Fix formating of comments. Should not start with a linebreak When displaying a comment, an additional linebreak was inserted right after the ";;" mark and before the first comment. This linebreak is removed here. --- diff --git a/src/gui/widgets/BasicBlockWidget.cxx b/src/gui/widgets/BasicBlockWidget.cxx index 1cdc33f..2a3f3b7 100644 --- a/src/gui/widgets/BasicBlockWidget.cxx +++ b/src/gui/widgets/BasicBlockWidget.cxx @@ -261,12 +261,11 @@ void BasicBlockWidget::populateWidget() { } QString BasicBlockWidget::formatComments(Instruction* inst) { - QString comments; + QStringList comments; for (Comment* c: inst->comments()) { - comments += "
"; - comments += QString(c->getText().c_str()).toHtmlEscaped(); + comments << QString(c->getText().c_str()).toHtmlEscaped(); } - return (comments == "" ? "" : ";; ") + comments.trimmed(); + return (comments.empty() ? "" : ";; ") + comments.join("
").trimmed(); } void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,