From d807f9910ad0ec8e7d1093924bc6c3b0d17614e4 Mon Sep 17 00:00:00 2001 From: Nav Date: Sat, 10 Dec 2022 22:05:18 +0000 Subject: [PATCH] Tidying --- .../TargetMemoryInspectionPane.cpp | 25 +++++++++++++------ 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp index 3a310053..4aad0700 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TargetMemoryInspectionPane/TargetMemoryInspectionPane.cpp @@ -447,10 +447,16 @@ namespace Bloom::Widgets this->refreshButton->setDisabled(false); } - } else if (newState == TargetState::RUNNING) { + return; + } + + if (newState == TargetState::RUNNING) { this->hexViewerWidget->setDisabled(true); this->refreshButton->setDisabled(true); - this->setStaleData(this->data.has_value()); + + if (this->data.has_value()) { + this->setStaleData(true); + } } } @@ -504,13 +510,18 @@ namespace Bloom::Widgets } void TargetMemoryInspectionPane::onTargetReset() { - this->setStaleData(this->data.has_value()); + if (this->data.has_value()) { + this->setStaleData(true); + } } void TargetMemoryInspectionPane::onProgrammingModeEnabled() { this->hexViewerWidget->setDisabled(true); this->refreshButton->setDisabled(true); - this->setStaleData(this->data.has_value()); + + if (this->data.has_value()) { + this->setStaleData(true); + } } void TargetMemoryInspectionPane::onProgrammingModeDisabled() { @@ -521,10 +532,10 @@ namespace Bloom::Widgets void TargetMemoryInspectionPane::onTargetMemoryWritten( TargetMemoryType memoryType, - TargetMemoryAddressRange addressRange + TargetMemoryAddressRange ) { - if (memoryType == this->targetMemoryDescriptor.type) { - this->setStaleData(this->data.has_value()); + if (memoryType == this->targetMemoryDescriptor.type && this->data.has_value()) { + this->setStaleData(true); } }