Replaced InsightWorker signals with InsightSignals singleton

This commit is contained in:
Nav
2022-09-07 22:25:28 +01:00
parent 227f0d4092
commit 0a45bca30a
16 changed files with 292 additions and 215 deletions

View File

@@ -2,6 +2,8 @@
#include <cmath>
#include "src/Insight/InsightSignals.hpp"
namespace Bloom::Widgets
{
using Bloom::Targets::TargetMemoryDescriptor;
@@ -54,8 +56,8 @@ namespace Bloom::Widgets
}
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
InsightSignals::instance(),
&InsightSignals::targetStateUpdated,
this,
&ByteItemGraphicsScene::onTargetStateChanged
);

View File

@@ -1,6 +1,7 @@
#include "HexViewerWidget.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
#include "src/Insight/InsightSignals.hpp"
#include "src/Helpers/Paths.hpp"
#include "src/Exceptions/Exception.hpp"
@@ -156,8 +157,8 @@ namespace Bloom::Widgets
);
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
InsightSignals::instance(),
&InsightSignals::targetStateUpdated,
this,
&HexViewerWidget::onTargetStateChanged
);

View File

@@ -4,6 +4,8 @@
#include <QToolButton>
#include "src/Insight/UserInterfaces/InsightWindow/UiLoader.hpp"
#include "src/Insight/InsightSignals.hpp"
#include "src/Insight/InsightWorker/InsightWorker.hpp"
#include "src/Insight/UserInterfaces/InsightWindow/Widgets/Label.hpp"
#include "src/Insight/InsightWorker/Tasks/ReadTargetMemory.hpp"
@@ -169,23 +171,25 @@ namespace Bloom::Widgets
&TargetMemoryInspectionPane::attach
);
auto* insightSignals = InsightSignals::instance();
QObject::connect(
&insightWorker,
&InsightWorker::targetStateUpdated,
insightSignals,
&InsightSignals::targetStateUpdated,
this,
&TargetMemoryInspectionPane::onTargetStateChanged
);
QObject::connect(
&insightWorker,
&InsightWorker::programmingModeEnabled,
insightSignals,
&InsightSignals::programmingModeEnabled,
this,
&TargetMemoryInspectionPane::onProgrammingModeEnabled
);
QObject::connect(
&insightWorker,
&InsightWorker::programmingModeDisabled,
insightSignals,
&InsightSignals::programmingModeDisabled,
this,
&TargetMemoryInspectionPane::onProgrammingModeDisabled
);
@@ -268,7 +272,7 @@ namespace Bloom::Widgets
);
}
this->insightWorker.queueTask(readStackPointerTask);
InsightWorker::queueTask(readStackPointerTask);
}
}
);
@@ -312,7 +316,7 @@ namespace Bloom::Widgets
);
}
this->insightWorker.queueTask(readMemoryTask);
InsightWorker::queueTask(readMemoryTask);
}
void TargetMemoryInspectionPane::resizeEvent(QResizeEvent* event) {