fix: Data inspector not updating correctly when data has changed
Fixes #1545
This commit is contained in:
parent
e016c8a702
commit
2f88994c37
@ -33,8 +33,10 @@ namespace hex::prv::undo {
|
||||
|
||||
template<std::derived_from<Operation> T>
|
||||
bool add(auto && ... args) {
|
||||
auto result = this->add(std::make_unique<T>(std::forward<decltype(args)>(args)...));
|
||||
EventDataChanged::post(m_provider);
|
||||
return this->add(std::make_unique<T>(std::forward<decltype(args)>(args)...));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
bool add(std::unique_ptr<Operation> &&operation);
|
||||
|
@ -29,8 +29,10 @@ namespace hex::plugin::builtin {
|
||||
};
|
||||
|
||||
private:
|
||||
void invalidateData();
|
||||
void updateInspectorRows();
|
||||
|
||||
|
||||
private:
|
||||
bool m_shouldInvalidate = true;
|
||||
|
||||
|
@ -24,7 +24,6 @@ namespace hex::plugin::builtin {
|
||||
ViewDataInspector::ViewDataInspector() : View::Window("hex.builtin.view.data_inspector.name", ICON_VS_INSPECT) {
|
||||
// Handle region selection
|
||||
EventRegionSelected::subscribe(this, [this](const auto ®ion) {
|
||||
|
||||
// Save current selection
|
||||
if (!ImHexApi::Provider::isValid() || region == Region::Invalid()) {
|
||||
m_validBytes = 0;
|
||||
@ -39,6 +38,11 @@ namespace hex::plugin::builtin {
|
||||
m_shouldInvalidate = true;
|
||||
});
|
||||
|
||||
EventDataChanged::subscribe(this, [this](const auto &provider) {
|
||||
if (provider == m_selectedProvider)
|
||||
m_shouldInvalidate = true;
|
||||
});
|
||||
|
||||
EventProviderClosed::subscribe(this, [this](const auto*) {
|
||||
m_selectedProvider = nullptr;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user