qt: Update save data dir open to use name from PSF. (#2954)
Some checks failed
Build and Release / reuse (push) Has been cancelled
Build and Release / clang-format (push) Has been cancelled
Build and Release / get-info (push) Has been cancelled
Build and Release / windows-sdl (push) Has been cancelled
Build and Release / windows-qt (push) Has been cancelled
Build and Release / macos-sdl (push) Has been cancelled
Build and Release / macos-qt (push) Has been cancelled
Build and Release / linux-sdl (push) Has been cancelled
Build and Release / linux-qt (push) Has been cancelled
Build and Release / linux-sdl-gcc (push) Has been cancelled
Build and Release / linux-qt-gcc (push) Has been cancelled
Build and Release / pre-release (push) Has been cancelled

This commit is contained in:
squidbus 2025-05-18 13:16:31 -07:00 committed by GitHub
parent 5eb58799fe
commit 034ae8cffa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 7 additions and 1 deletions

View file

@ -79,6 +79,11 @@ public:
if (const auto play_time = psf.GetString("PLAY_TIME"); play_time.has_value()) { if (const auto play_time = psf.GetString("PLAY_TIME"); play_time.has_value()) {
game.play_time = *play_time; game.play_time = *play_time;
} }
if (const auto save_dir = psf.GetString("INSTALL_DIR_SAVEDATA"); save_dir.has_value()) {
game.save_dir = *save_dir;
} else {
game.save_dir = game.serial;
}
} }
return game; return game;
} }

View file

@ -25,6 +25,7 @@ struct GameInfo {
std::string version = "Unknown"; std::string version = "Unknown";
std::string region = "Unknown"; std::string region = "Unknown";
std::string fw = "Unknown"; std::string fw = "Unknown";
std::string save_dir = "Unknown";
std::string play_time = "Unknown"; std::string play_time = "Unknown";
CompatibilityEntry compatibility = CompatibilityEntry{CompatibilityStatus::Unknown}; CompatibilityEntry compatibility = CompatibilityEntry{CompatibilityStatus::Unknown};

View file

@ -160,7 +160,7 @@ public:
Common::FS::PathToQString(userPath, Common::FS::PathToQString(userPath,
Common::FS::GetUserPath(Common::FS::PathType::UserDir)); Common::FS::GetUserPath(Common::FS::PathType::UserDir));
QString saveDataPath = QString saveDataPath =
userPath + "/savedata/1/" + QString::fromStdString(m_games[itemID].serial); userPath + "/savedata/1/" + QString::fromStdString(m_games[itemID].save_dir);
QDir(saveDataPath).mkpath(saveDataPath); QDir(saveDataPath).mkpath(saveDataPath);
QDesktopServices::openUrl(QUrl::fromLocalFile(saveDataPath)); QDesktopServices::openUrl(QUrl::fromLocalFile(saveDataPath));
} }