diff --git a/Source/Core/Core/State.cpp b/Source/Core/Core/State.cpp index cd4544b8f1..8a45b2f277 100644 --- a/Source/Core/Core/State.cpp +++ b/Source/Core/Core/State.cpp @@ -323,7 +323,7 @@ static void CompressAndDumpState(CompressAndDumpState_args save_args) if (!File::Rename(filename, File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav")) Core::DisplayMessage("Failed to move previous state to state undo backup", 1000); - else + else if (File::Exists(filename + ".dtm")) File::Rename(filename + ".dtm", File::GetUserPath(D_STATESAVES_IDX) + "lastState.sav.dtm"); } diff --git a/Source/Core/DolphinQt/MainWindow.cpp b/Source/Core/DolphinQt/MainWindow.cpp index b7ce9d5206..00a1bf6576 100644 --- a/Source/Core/DolphinQt/MainWindow.cpp +++ b/Source/Core/DolphinQt/MainWindow.cpp @@ -1183,8 +1183,7 @@ void MainWindow::StateLoadSlot() void MainWindow::StateSaveSlot() { - State::Save(m_state_slot, true); - m_menu_bar->UpdateStateSlotMenu(); + State::Save(m_state_slot); } void MainWindow::StateLoadSlotAt(int slot) @@ -1199,8 +1198,7 @@ void MainWindow::StateLoadLastSavedAt(int slot) void MainWindow::StateSaveSlotAt(int slot) { - State::Save(slot, true); - m_menu_bar->UpdateStateSlotMenu(); + State::Save(slot); } void MainWindow::StateLoadUndo() diff --git a/Source/Core/DolphinQt/MenuBar.cpp b/Source/Core/DolphinQt/MenuBar.cpp index 67dcc4d172..f890742f5e 100644 --- a/Source/Core/DolphinQt/MenuBar.cpp +++ b/Source/Core/DolphinQt/MenuBar.cpp @@ -313,6 +313,9 @@ void MenuBar::AddEmulationMenu() AddStateSaveMenu(emu_menu); AddStateSlotMenu(emu_menu); UpdateStateSlotMenu(); + + for (QMenu* menu : {m_state_load_menu, m_state_save_menu, m_state_slot_menu}) + connect(menu, &QMenu::aboutToShow, this, &MenuBar::UpdateStateSlotMenu); } void MenuBar::AddStateLoadMenu(QMenu* emu_menu) diff --git a/Source/Core/DolphinQt/MenuBar.h b/Source/Core/DolphinQt/MenuBar.h index 1140f7168f..8d4681928f 100644 --- a/Source/Core/DolphinQt/MenuBar.h +++ b/Source/Core/DolphinQt/MenuBar.h @@ -37,7 +37,6 @@ public: explicit MenuBar(QWidget* parent = nullptr); - void UpdateStateSlotMenu(); void UpdateToolsMenu(bool emulation_started); QMenu* GetListColumnsMenu() const { return m_cols_menu; } @@ -140,6 +139,8 @@ private: void AddJITMenu(); void AddSymbolsMenu(); + void UpdateStateSlotMenu(); + void InstallWAD(); void ImportWiiSave(); void ExportWiiSaves();