fix: File changed popup showing up when saving memory mapped file
This commit is contained in:
parent
3897245a7e
commit
0f4504476a
@ -67,6 +67,7 @@ namespace hex::plugin::builtin {
|
||||
wolv::io::ChangeTracker m_changeTracker;
|
||||
std::vector<u8> m_data;
|
||||
bool m_loadedIntoMemory = false;
|
||||
bool m_ignoreNextChangeEvent = false;
|
||||
|
||||
std::optional<struct stat> m_fileStats;
|
||||
|
||||
|
@ -68,6 +68,7 @@ namespace hex::plugin::builtin {
|
||||
|
||||
void FileProvider::save() {
|
||||
if (m_loadedIntoMemory) {
|
||||
m_ignoreNextChangeEvent = true;
|
||||
m_file.open();
|
||||
m_file.writeVectorAtomic(0x00, m_data);
|
||||
m_file.setSize(m_data.size());
|
||||
@ -333,6 +334,11 @@ namespace hex::plugin::builtin {
|
||||
}
|
||||
|
||||
void FileProvider::handleFileChange() {
|
||||
if (m_ignoreNextChangeEvent) {
|
||||
m_ignoreNextChangeEvent = false;
|
||||
return;
|
||||
}
|
||||
|
||||
ui::PopupQuestion::open("hex.builtin.provider.file.reload_changes"_lang, [this] {
|
||||
this->close();
|
||||
(void)this->open();
|
||||
|
Loading…
Reference in New Issue
Block a user