Refresh hex viewer when opening previous opened snapshot diff window

This commit is contained in:
Nav
2023-05-07 03:14:37 +01:00
parent c7a6ad26ec
commit 68059e9dfd

View File

@@ -381,27 +381,40 @@ namespace Bloom::Widgets
auto snapshotDiffIt = this->snapshotCurrentDiffsBySnapshotAId.find(snapshotIdA); auto snapshotDiffIt = this->snapshotCurrentDiffsBySnapshotAId.find(snapshotIdA);
if (snapshotDiffIt == this->snapshotCurrentDiffsBySnapshotAId.end()) { if (snapshotDiffIt != this->snapshotCurrentDiffsBySnapshotAId.end()) {
const auto& snapshotItA = this->snapshotsById.find(snapshotIdA); auto* snapshotDiff = snapshotDiffIt.value();
if (snapshotItA == this->snapshotsById.end()) { snapshotDiff->refreshB(
return; *(this->data),
} this->focusedMemoryRegions,
this->excludedMemoryRegions,
snapshotDiffIt = this->snapshotCurrentDiffsBySnapshotAId.insert( this->stackPointer.value_or(0)
snapshotIdA,
new SnapshotDiff(
snapshotItA.value(),
*(this->data),
this->focusedMemoryRegions,
this->excludedMemoryRegions,
this->stackPointer.value_or(0),
this->memoryDescriptor,
this
)
); );
snapshotDiff->show();
snapshotDiff->activateWindow();
return;
} }
const auto& snapshotItA = this->snapshotsById.find(snapshotIdA);
if (snapshotItA == this->snapshotsById.end()) {
return;
}
snapshotDiffIt = this->snapshotCurrentDiffsBySnapshotAId.insert(
snapshotIdA,
new SnapshotDiff(
snapshotItA.value(),
*(this->data),
this->focusedMemoryRegions,
this->excludedMemoryRegions,
this->stackPointer.value_or(0),
this->memoryDescriptor,
this
)
);
auto* snapshotDiff = snapshotDiffIt.value(); auto* snapshotDiff = snapshotDiffIt.value();
snapshotDiff->show(); snapshotDiff->show();
snapshotDiff->activateWindow(); snapshotDiff->activateWindow();