launcher: run the emulator from a per-user data directory on macOS (#2491) #2514
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!2514
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2514"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@mitsa-ng on GitHub · 2026-11-22 09:50 UTC · original
mitsa-ng:launcher-macos-data-location→main· +28 −0 · 1 files · 1 commits · openFixes #2491.
Problem
The launcher started
kyty_emulatorwith the working directory set toContents/MacOSinside the bundle, so_SaveData,_PipelineCache,_TempData,_DownloadDataand the log all lived insideKytyPS5.app: replacing the app (the usual macOS update path) deleted the saves, standard accounts in/Applicationscannot write there, and the new folders break the code-signature seal.Change
Implements the approach proposed by @rafalohaki in the issue: on macOS run the emulator from
~/Library/Application Support/KytyPS5(created on first launch) and move the four data folders an older launcher left in the bundle there once; a rename that fails (cross-volume, no write access) leaves the old copy in place rather than dropping anything. Other platforms keep the install-folder working directory.Evidence
Green on Windows/Linux/macOS CI with this branch on my fork (run 44985643134).
Written with AI assistance (ZCode); built by the author.
@coderabbitai[bot] on GitHub · 2026-11-22 09:54 UTC · original
Walkthrough
On macOS, the launcher now selects a per-user app-data directory for the emulator’s working directory. It appends
KytyPS5when needed, falls back to the bundle directory if directory creation fails, and attempts to rename four existing data folders when their destinations do not exist. Other platforms continue to use the interpreter’s containing directory as the working directory.Suggested reviewers:
nmzik,pipe530Change: Bug fix · Severity of issue fixed: Medium
Merge Risk:
Moderate · up to
9329aOn macOS, the launcher will no longer find a game's saves after they move to the per-user folder, so the remove-save-data action reports that nothing was found. If a save folder fails to migrate, the old saves stay inside the app and can be lost when the app is replaced. Fix both before merging.
Pre-merge checks:
4
#2491] requires that macOS emulator data leave KytyPS5.app, that saves survive app replacement, that standard accounts can write data, and that the bundle seal is not broken by new files. The diff to…Full details: Title check
Explanation
The title names the main change: on macOS the launcher runs the emulator from a per-user data directory. It matches the raw summary (EmulatorDataDirectory, working directory set to the per-user location) and the objectives. It also cites the issue number, which is acceptable. Length is slightly long but the title is clear and specific.
Full details: Description check
Explanation
The description states the problem (emulator data stored inside KytyPS5.app, lost on update, write failures for standard users, broken code-signature seal), the change (per-user data directory on macOS, one-time move of four data folders, fallback when a rename fails), and CI evidence. It is directly related to the changeset.
Full details: Linked Issues check
Explanation
[
#2491] requires that macOS emulator data leave KytyPS5.app, that saves survive app replacement, that standard accounts can write data, and that the bundle seal is not broken by new files. The diff to src/launcher/src/mainDialog.cpp (merge base to head) adds EmulatorDataDirectory(). On APPLE, RunInterpreter() now sets the process working directory to ~/Library/Application Support/KytyPS5 (created with QDir().mkpath). The emulator resolves _SaveData, _PipelineCache, _TempData, _DownloadData and _kyty.txt relative to its working directory, so these now resolve outside the bundle. The function also moves the four data folders from the bundle to the new directory once, when the destination folder does not exist. Non-Apple builds keep the install-folder working directory, as the issue does not request a change there. Gaps: no automated test was added. The issue states that the behavior was verified only by a log-file check. The rename path depends on the filesystem and was not exercised. When a destination folder already exists, the bundle copy is left in place and is not moved. The author documents these cases as intended. The requirements are behavioral and the code implements them, so the assessment is PASS.Full details: Out of Scope Changes check
Explanation
The reviewed whole-PR diff against the merge base changes only src/launcher/src/mainDialog.cpp, with +28/-0 lines. The change adds the QStandardPaths include, the macOS-only EmulatorDataDirectory helper, and a macOS-only branch for the working directory. Each change serves the objective of
#2491. The Windows and Linux branch keeps the original behavior. No unrelated files or refactors were identified in the evidence available.Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
@ -340,0 +354,4 @@const QString from = QDir(bundle_dir).absoluteFilePath(QString::fromLatin1(name));const QString to = data_dir + '/' + name;if (QFile::exists(from) && !QFile::exists(to)) {QDir().rename(from, to);@coderabbitai[bot] on GitHub · 2026-11-22 09:54 UTC · original
Handle migration failure before continuing the launch.
If
_SaveDatacannot move, this call returnsfalse, but the helper still returnsdata_dir. Qt 6.8 documents this failure result forQDir::rename. (doc.qt.io)The old saves remain only inside the app bundle. Replacing the app can therefore still delete them, contrary to the migration objective.
Check the result. If required data cannot migrate, stop with an actionable error or complete a verified copy before continuing. Do not simply return
bundle_dirafter the loop: other folders might already have moved. Keep the current launch path when migration succeeds.@ -451,2 +475,4 @@CmdCommand(QDir::toNativeSeparators(interpreter), args, close_terminal));#endif#if defined(__APPLE__)process->setWorkingDirectory(EmulatorDataDirectory(QFileInfo(interpreter).absolutePath()));@coderabbitai[bot] on GitHub · 2026-11-22 09:54 UTC · original
The save-data lookup misses saves on macOS.
GetSaveDataDirssearches only the launcher's current directory, the application directory, and their parents. On macOS, the emulator now runs from~/Library/Application Support/KytyPS5, and its saves are written there. That directory is not one of the lookup roots, and the launcher does not change its own current directory to it. As a result, the remove-save-data action reports "No save data folder found for this game." for macOS games whose saves are in the new location. The same lookup also determines the menu state atconfigurationListWidget.cpp:1280.The save-data lookup must search the same per-user data root that
RunInterpreteruses as the emulator working directory on macOS. Other platforms keep their current roots.@coderabbitai[bot] on GitHub · 2026-11-22 09:55 UTC · original · reviewed
Actionable comments posted: 2
5f6962cd-a9b1-47fa-8bb8-97ee2fddf7b5Reviewing files that changed from the base of the PR and between
6133172164and9329a186ab.src/launcher/src/mainDialog.cppIncluded review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.