From: Christoph Egger Date: Mon, 23 Feb 2015 15:33:59 +0000 (+0100) Subject: Add link handler only once for each basic block X-Git-Tag: v0.1~90 X-Git-Url: https://git.siccegge.de//index.cgi?a=commitdiff_plain;h=3894c7f40260a8f5f4b47e82860ae40ec592efc1;p=frida%2Ffrida.git Add link handler only once for each basic block --- diff --git a/src/gui/widgets/BasicBlockWidget.cxx b/src/gui/widgets/BasicBlockWidget.cxx index 8e7e440..0036bda 100644 --- a/src/gui/widgets/BasicBlockWidget.cxx +++ b/src/gui/widgets/BasicBlockWidget.cxx @@ -69,6 +69,15 @@ BasicBlockWidget::BasicBlockWidget(const QString& name, BasicBlock * block, Qt::LinksAccessibleByMouse); if (width < 250) width = 250; + + QObject::connect(_widget.get(), &QGraphicsTextItem::linkActivated, + [=](QString str) { + if (str.startsWith("function:")) { + QString address = str.remove("function:"); + mainwindow->switchMainPlaneToAddress(address.toInt(NULL, 16)); + } + }); +} } void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, @@ -102,14 +111,6 @@ void BasicBlockWidget::addItem(uint8_t* bytes, size_t num_bytes, } _table->cellAt(row, 1).firstCursorPosition().insertHtml(line); - - QObject::connect(_widget.get(), &QGraphicsTextItem::linkActivated, - [=](QString str) { - if (str.startsWith("function:")) { - QString address = str.remove("function:"); - mainwindow->switchMainPlaneToAddress(address.toInt(NULL, 16)); - } - }); } void BasicBlockWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option,