X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;fp=src%2Fgui%2FMainwindow.cxx;h=1add669e55c6f32c3174f74e45123f71e746aa4c;hp=850c0364b61ba1c4d5fc845586ba8913fe48f9d9;hb=f9d8bd4a0312a92a1ec3493e83996c0a99d8d1bf;hpb=edf204645cccc7dfd4b2558f0fe6ab17675e6e2d diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 850c036..1add669 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -87,7 +87,7 @@ Mainwindow::Mainwindow(InformationManager* mgr) setWindowTitle(tr("FRIDA")); - QTreeWidgetItem * external = new QTreeWidgetItem(listWidget, QStringList("External Functions")); + external = new QTreeWidgetItem(listWidget, QStringList("External Functions")); external->setChildIndicatorPolicy(QTreeWidgetItem::ShowIndicator); external->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd))); connect(mgr, &InformationManager::resetEvent, @@ -96,15 +96,7 @@ Mainwindow::Mainwindow(InformationManager* mgr) mgr->getDisassembler(), SLOT(disassembleFunctionAt(uint64_t))); }); connect(mgr, &InformationManager::newFunctionEvent, - [=] (NewFunctionEvent* event) { - std::string name = event->function->getName(); - if (event->function->isDynamic()) { - auto item = new QTreeWidgetItem(external, QStringList(name.c_str())); - item->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd))); - } else { - addFunction(event->function); - } - }); + this, &Mainwindow::handleNewFunctionEvent); connect(mgr, &InformationManager::renameFunctionEvent, [&](RenameFunctionEvent* event) { if (objects_list_by_address.find(event->address) == objects_list_by_address.end()) @@ -126,6 +118,16 @@ void Mainwindow::setGlobalHotkeys() { }); } +void Mainwindow::handleNewFunctionEvent(NewFunctionEvent event) { + std::string name = event.function->getName(); + if (event.function->isDynamic()) { + auto item = new QTreeWidgetItem(external, QStringList(name.c_str())); + item->setBackground(0, QBrush(QColor(0xff, 0xdd, 0xdd))); + } else { + addFunction(event.function); + } +} + void Mainwindow::quit() { QMessageBox messageBox;