refactor: Better interface for the event system

This commit is contained in:
WerWolv
2023-12-08 10:29:44 +01:00
parent f08d1e265c
commit b4813660b5
63 changed files with 327 additions and 320 deletions

View File

@@ -49,7 +49,7 @@ namespace hex::plugin::builtin {
};
ViewHashes::ViewHashes() : View::Window("hex.builtin.view.hashes.name") {
EventManager::subscribe<EventRegionSelected>(this, [this](const auto &providerRegion) {
EventRegionSelected::subscribe(this, [this](const auto &providerRegion) {
for (auto &function : this->m_hashFunctions.get(providerRegion.getProvider()))
function.reset();
});
@@ -124,7 +124,7 @@ namespace hex::plugin::builtin {
}
ViewHashes::~ViewHashes() {
EventManager::unsubscribe<EventRegionSelected>(this);
EventRegionSelected::unsubscribe(this);
}