]> git.siccegge.de Git - frida/frida.git/commitdiff
Fix formating of comments. Should not start with a linebreak
authorChristoph Egger <christoph@christoph-egger.org>
Mon, 25 May 2015 04:28:32 +0000 (06:28 +0200)
committerChristoph Egger <christoph@christoph-egger.org>
Mon, 25 May 2015 04:28:32 +0000 (06:28 +0200)
When displaying a comment, an additional linebreak was inserted right
after the ";;" mark and before the first comment. This linebreak is
removed here.

src/gui/widgets/BasicBlockWidget.cxx

index 1cdc33f3dc7eb2ce4cf67f84ba8b1e77a0f24d0d..2a3f3b7d992f30f4f5089754a1016bf221ac13c7 100644 (file)
@@ -261,12 +261,11 @@ void BasicBlockWidget::populateWidget() {
 }
 
 QString BasicBlockWidget::formatComments(Instruction* inst) {
-       QString comments;
+       QStringList comments;
        for (Comment* c: inst->comments()) {
-               comments += "<br />";
-               comments += QString(c->getText().c_str()).toHtmlEscaped();
+               comments << QString(c->getText().c_str()).toHtmlEscaped();
        }
-       return (comments == "" ? "" : ";; ") + comments.trimmed();
+       return (comments.empty() ? "" : ";; ") + comments.join("<br />").trimmed();
 }
 
 void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem*,