From d557a294feb3ecae8ec22adca0909e2d3adcc459 Mon Sep 17 00:00:00 2001 From: Matt Borgerson Date: Sun, 4 Jun 2023 19:35:04 -0700 Subject: [PATCH] ui: Move dvd path settings update to lower level for now --- ui/xemu.c | 4 ++++ ui/xui/actions.cc | 3 --- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/ui/xemu.c b/ui/xemu.c index 1f009b1104a..261dfd93f29 100644 --- a/ui/xemu.c +++ b/ui/xemu.c @@ -1562,6 +1562,7 @@ void xemu_eject_disc(Error **errp) Error *error = NULL; xbox_smc_eject_button(); + xemu_settings_set_string(&g_config.sys.files.dvd_path, ""); // Xbox software may request that the drive open, but do it now anyway qmp_eject(true, "ide0-cd1", false, NULL, true, false, &error); @@ -1578,12 +1579,15 @@ void xemu_load_disc(const char *path, Error **errp) // Ensure an eject sequence is always triggered so Xbox software reloads xbox_smc_eject_button(); + xemu_settings_set_string(&g_config.sys.files.dvd_path, ""); qmp_blockdev_change_medium(true, "ide0-cd1", false, NULL, path, false, "", false, 0, &error); if (error) { error_propagate(errp, error); + } else { + xemu_settings_set_string(&g_config.sys.files.dvd_path, path); } xbox_smc_update_tray_state(); diff --git a/ui/xui/actions.cc b/ui/xui/actions.cc index f6e8cb29ec8..dc2c830c50d 100644 --- a/ui/xui/actions.cc +++ b/ui/xui/actions.cc @@ -26,8 +26,6 @@ void ActionEjectDisc(void) { - xemu_settings_set_string(&g_config.sys.files.dvd_path, ""); - Error *err = NULL; xemu_eject_disc(&err); if (err) { @@ -48,7 +46,6 @@ void ActionLoadDisc(void) /* Cancelled */ return; } - xemu_settings_set_string(&g_config.sys.files.dvd_path, new_disc_path); xemu_load_disc(new_disc_path, &err); if (err) {