From b639584acc82b46e1ccbe92483f6d26fbe521287 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Sun, 6 Jan 2019 23:30:38 +0100 Subject: [PATCH] Emu/Qt: Fix Boot Recent when using BootGame(add_only=true) --- rpcs3/Emu/Cell/Modules/cellMsgDialog.h | 2 +- rpcs3/Emu/System.cpp | 3 +++ rpcs3/Emu/System.h | 1 + rpcs3/rpcs3qt/main_window.cpp | 5 ++++- rpcs3/rpcs3qt/main_window.h | 2 +- rpcs3/rpcs3qt/msg_dialog_frame.cpp | 2 +- rpcs3/rpcs3qt/msg_dialog_frame.h | 2 +- rpcs3/rpcs3qt/progress_dialog.cpp | 2 +- rpcs3/rpcs3qt/progress_dialog.h | 2 +- 9 files changed, 14 insertions(+), 7 deletions(-) diff --git a/rpcs3/Emu/Cell/Modules/cellMsgDialog.h b/rpcs3/Emu/Cell/Modules/cellMsgDialog.h index 0527f77b48..0e98cfd16a 100644 --- a/rpcs3/Emu/Cell/Modules/cellMsgDialog.h +++ b/rpcs3/Emu/Cell/Modules/cellMsgDialog.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "Utilities/BitField.h" diff --git a/rpcs3/Emu/System.cpp b/rpcs3/Emu/System.cpp index 693c8eb493..2640b11ab2 100644 --- a/rpcs3/Emu/System.cpp +++ b/rpcs3/Emu/System.cpp @@ -607,6 +607,8 @@ bool Emulator::BootGame(const std::string& path, bool direct, bool add_only, boo "/USRDIR/ISO.BIN.EDAT", }; + m_path_old = m_path; + if (direct && fs::exists(path)) { m_path = path; @@ -1126,6 +1128,7 @@ void Emulator::Load(bool add_only, bool force_global_config) if (add_only) { LOG_NOTICE(LOADER, "Finished to add data to games.yml by boot for: %s", m_path); + m_path = m_path_old; // Reset m_path to fix boot from gui return; } diff --git a/rpcs3/Emu/System.h b/rpcs3/Emu/System.h index 8d19ea9f7f..fbe6e23c9a 100644 --- a/rpcs3/Emu/System.h +++ b/rpcs3/Emu/System.h @@ -214,6 +214,7 @@ class Emulator final atomic_t m_pause_amend_time; // increased when resumed std::string m_path; + std::string m_path_old; std::string m_title_id; std::string m_title; std::string m_cat; diff --git a/rpcs3/rpcs3qt/main_window.cpp b/rpcs3/rpcs3qt/main_window.cpp index f75d645a9e..586256bd65 100644 --- a/rpcs3/rpcs3qt/main_window.cpp +++ b/rpcs3/rpcs3qt/main_window.cpp @@ -291,7 +291,10 @@ void main_window::Boot(const std::string& path, bool direct, bool add_only, bool { LOG_SUCCESS(LOADER, "Boot successful."); const std::string serial = Emu.GetTitleID().empty() ? "" : "[" + Emu.GetTitleID() + "] "; - AddRecentAction(gui::Recent_Game(qstr(Emu.GetBoot()), qstr(serial + Emu.GetTitle()))); + if (!add_only) + { + AddRecentAction(gui::Recent_Game(qstr(Emu.GetBoot()), qstr(serial + Emu.GetTitle()))); + } } else { diff --git a/rpcs3/rpcs3qt/main_window.h b/rpcs3/rpcs3qt/main_window.h index 2e39786cba..c2ef26de03 100644 --- a/rpcs3/rpcs3qt/main_window.h +++ b/rpcs3/rpcs3qt/main_window.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #ifdef _WIN32 #include diff --git a/rpcs3/rpcs3qt/msg_dialog_frame.cpp b/rpcs3/rpcs3qt/msg_dialog_frame.cpp index f8ce44e23d..7084023340 100644 --- a/rpcs3/rpcs3qt/msg_dialog_frame.cpp +++ b/rpcs3/rpcs3qt/msg_dialog_frame.cpp @@ -1,4 +1,4 @@ - + #include "msg_dialog_frame.h" #include diff --git a/rpcs3/rpcs3qt/msg_dialog_frame.h b/rpcs3/rpcs3qt/msg_dialog_frame.h index 5607fc2107..dc6204df08 100644 --- a/rpcs3/rpcs3qt/msg_dialog_frame.h +++ b/rpcs3/rpcs3qt/msg_dialog_frame.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "stdafx.h" #include "Emu/Memory/vm.h" diff --git a/rpcs3/rpcs3qt/progress_dialog.cpp b/rpcs3/rpcs3qt/progress_dialog.cpp index 1e1b2c8974..d093643340 100644 --- a/rpcs3/rpcs3qt/progress_dialog.cpp +++ b/rpcs3/rpcs3qt/progress_dialog.cpp @@ -1,4 +1,4 @@ -#include "progress_dialog.h" +#include "progress_dialog.h" #include diff --git a/rpcs3/rpcs3qt/progress_dialog.h b/rpcs3/rpcs3qt/progress_dialog.h index aa03529177..0e92a8bd2d 100644 --- a/rpcs3/rpcs3qt/progress_dialog.h +++ b/rpcs3/rpcs3qt/progress_dialog.h @@ -1,4 +1,4 @@ -#pragma once +#pragma once #include "stdafx.h"