Fix: sce_sys/snd0.at9 remains after game deletion (#2565)

This commit is contained in:
DanielSvoboda 2025-02-28 18:11:41 -03:00 committed by GitHub
parent 99c7fc4049
commit db868ea400
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 2 deletions

View file

@ -40,4 +40,5 @@ void BackgroundMusicPlayer::playMusic(const QString& snd0path, bool loops) {
void BackgroundMusicPlayer::stopMusic() {
m_mediaPlayer->stop();
m_mediaPlayer->setSource(QUrl(""));
}

View file

@ -10,6 +10,7 @@
#include <QTreeWidget>
#include <QTreeWidgetItem>
#include <qt_gui/background_music_player.h>
#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!")));