From 00ae54bdec18bc3da94436d40b44a2b6cfaafc2b Mon Sep 17 00:00:00 2001 From: "Mr. eXoDia" Date: Sat, 9 Aug 2014 13:31:29 +0200 Subject: [PATCH] GUI: fixed duplicate infobox lines and duplicate follow in dump entries --- x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp | 3 +++ x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp | 12 ++++++++++++ x64_dbg_gui/Project/Src/Gui/CPUInfoBox.h | 1 + 3 files changed, 16 insertions(+) diff --git a/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp b/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp index 97ed1378..39a2708f 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUDisassembly.cpp @@ -82,6 +82,9 @@ void CPUDisassembly::mouseDoubleClickEvent(QMouseEvent* event) void CPUDisassembly::addFollowMenuItem(QString name, int_t value) { + foreach(QAction * action, mFollowMenu->actions()) //check for duplicate action + if(action->text() == name) + return; QAction* newAction = new QAction(name, this); newAction->setFont(QFont("Courier New", 8)); mFollowMenu->addAction(newAction); diff --git a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp index a64a2791..4a88e42e 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp +++ b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.cpp @@ -30,6 +30,13 @@ void CPUInfoBox::setInfoLine(int line, QString text) reloadData(); } +QString CPUInfoBox::getInfoLine(int line) +{ + if(line < 0 || line > 2) + return QString(); + return getCellContent(line, 0); +} + void CPUInfoBox::clear() { setInfoLine(0, ""); @@ -133,6 +140,8 @@ void CPUInfoBox::disasmSelectionChanged(int_t parVA) j++; } } + if(getInfoLine(0) == getInfoLine(1)) //check for duplicate info line + setInfoLine(1, ""); //set last line QString info; char mod[MAX_MODULE_SIZE] = ""; @@ -169,6 +178,9 @@ void CPUInfoBox::followActionSlot() void CPUInfoBox::addFollowMenuItem(QMenu* menu, QString name, int_t value) { + foreach(QAction * action, menu->actions()) //check for duplicate action + if(action->text() == name) + return; QAction* newAction = new QAction(name, this); newAction->setFont(QFont("Courier New", 8)); menu->addAction(newAction); diff --git a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.h b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.h index 3fd5764d..3d336a37 100644 --- a/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.h +++ b/x64_dbg_gui/Project/Src/Gui/CPUInfoBox.h @@ -25,6 +25,7 @@ private: int_t curAddr; QString getSymbolicName(int_t addr); void setInfoLine(int line, QString text); + QString getInfoLine(int line); void clear(); };