From db868ea40076a981ac010b1f85e2503cbac526fb Mon Sep 17 00:00:00 2001 From: DanielSvoboda Date: Fri, 28 Feb 2025 18:11:41 -0300 Subject: [PATCH] Fix: sce_sys/snd0.at9 remains after game deletion (#2565) --- src/qt_gui/background_music_player.cpp | 1 + src/qt_gui/gui_context_menus.h | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/qt_gui/background_music_player.cpp b/src/qt_gui/background_music_player.cpp index a63f1d1be..e2b7177b3 100644 --- a/src/qt_gui/background_music_player.cpp +++ b/src/qt_gui/background_music_player.cpp @@ -40,4 +40,5 @@ void BackgroundMusicPlayer::playMusic(const QString& snd0path, bool loops) { void BackgroundMusicPlayer::stopMusic() { m_mediaPlayer->stop(); + m_mediaPlayer->setSource(QUrl("")); } diff --git a/src/qt_gui/gui_context_menus.h b/src/qt_gui/gui_context_menus.h index 8a6e07847..df86686f3 100644 --- a/src/qt_gui/gui_context_menus.h +++ b/src/qt_gui/gui_context_menus.h @@ -10,6 +10,7 @@ #include #include +#include #include "cheats_patches.h" #include "common/config.h" #include "common/version.h" @@ -442,9 +443,12 @@ public: Common::FS::GetUserPath(Common::FS::PathType::MetaDataDir) / m_games[itemID].serial / "TrophyFiles"); - QString message_type = tr("Game"); + QString message_type; - if (selected == deleteUpdate) { + if (selected == deleteGame) { + BackgroundMusicPlayer::getInstance().stopMusic(); + message_type = tr("Game"); + } else if (selected == deleteUpdate) { if (!std::filesystem::exists(Common::FS::PathFromQString(game_update_path))) { QMessageBox::critical(nullptr, tr("Error"), QString(tr("This game has no update to delete!")));