From cc26aa97f13469e4043079b2dc5d35eedb817038 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sun, 12 Dec 2021 15:56:23 +0600 Subject: [PATCH 1/2] Don't unmount ZIP and MO drives on settings save --- src/qt/qt_settingsotherremovable.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/qt/qt_settingsotherremovable.cpp b/src/qt/qt_settingsotherremovable.cpp index 2e989cda1..f101afd14 100644 --- a/src/qt/qt_settingsotherremovable.cpp +++ b/src/qt/qt_settingsotherremovable.cpp @@ -128,7 +128,6 @@ SettingsOtherRemovable::~SettingsOtherRemovable() void SettingsOtherRemovable::save() { auto* model = ui->tableViewMO->model(); - memset(mo_drives, 0, sizeof(mo_drives)); for (int i = 0; i < MO_NUM; i++) { mo_drives[i].f = NULL; mo_drives[i].priv = NULL; @@ -138,7 +137,6 @@ void SettingsOtherRemovable::save() { } model = ui->tableViewZIP->model(); - memset(zip_drives, 0, sizeof(zip_drives)); for (int i = 0; i < ZIP_NUM; i++) { zip_drives[i].f = NULL; zip_drives[i].priv = NULL; From ba4db8de60e3edc69cf297938b95768ce7f9b35a Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Sun, 12 Dec 2021 15:58:06 +0600 Subject: [PATCH 2/2] Don't umount CD drives on settings exit --- src/qt/qt_settingsfloppycdrom.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/qt/qt_settingsfloppycdrom.cpp b/src/qt/qt_settingsfloppycdrom.cpp index 5a578ca61..f6f0fb94c 100644 --- a/src/qt/qt_settingsfloppycdrom.cpp +++ b/src/qt/qt_settingsfloppycdrom.cpp @@ -131,8 +131,15 @@ void SettingsFloppyCDROM::save() { /* Removable devices category */ model = ui->tableViewCDROM->model(); - memset(cdrom, 0, sizeof(cdrom)); for (int i = 0; i < CDROM_NUM; i++) { + cdrom[i].img_fp = NULL; + cdrom[i].priv = NULL; + cdrom[i].ops = NULL; + cdrom[i].image = NULL; + cdrom[i].insert = NULL; + cdrom[i].close = NULL; + cdrom[i].get_volume = NULL; + cdrom[i].get_channel = NULL; cdrom[i].bus_type = model->index(i, 0).data(Qt::UserRole).toUInt(); cdrom[i].res = model->index(i, 0).data(Qt::UserRole + 1).toUInt(); cdrom[i].speed = model->index(i, 1).data(Qt::UserRole).toUInt();