[PR #1329] [MERGED] Slightly refactor the game install dirs code #2050

Closed
opened 2026-02-27 21:14:59 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/shadps4-emu/shadPS4/pull/1329
Author: @KrisCris
Created: 10/10/2024
Status: Merged
Merged: 10/11/2024
Merged by: @georgemoralis

Base: mainHead: game_folder_fix


📝 Commits (10+)

  • 85c4805 fix: game dir dupes on each launch
  • 420e4c0 fix copy around settings_addon_install_dir vector
  • 70cb429 do not show the path if it is not added
  • 01e39a4 remove installDir from config file
  • b0e7c3d Merge branch 'main' into game_folder_fix
  • 0347c72 format
  • 79f8298 Merge branch 'main' into game_folder_fix
  • 13c1c34 moved migration code to save, and added notice
  • fa53fb4 move ui->removeFolderButton->setEnabled to LoadValuesFromConfig
  • 4e294dd avoid checking duplicates for gameDirs loaded from config

📊 Changes

4 files changed (+32 additions, -40 deletions)

View changed files

📝 src/common/config.cpp (+23 -15)
📝 src/common/config.h (+3 -2)
📝 src/qt_gui/game_install_dialog.cpp (+1 -4)
📝 src/qt_gui/settings_dialog.cpp (+5 -19)

📄 Description

Well... I think I made this PR too late (originally as a fix of https://github.com/shadps4-emu/shadPS4/issues/1325), so some of the issues have already been fixed, sorry. But here it is.

The main reason #1308 duplicates installDir is that the config is not removed from the file. (github.com/shadps4-emu/shadPS4@01e39a4e70)

Meanwhile, I replaced setGameInstallDirs with addGameInstallDir and removeGameInstallDir so no more duplicated path-adding/removing code, and avoid passing the vectors around; The return value of getGameInstallDirs is made const& so it won't be copied and modified everywhere.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/shadps4-emu/shadPS4/pull/1329 **Author:** [@KrisCris](https://github.com/KrisCris) **Created:** 10/10/2024 **Status:** ✅ Merged **Merged:** 10/11/2024 **Merged by:** [@georgemoralis](https://github.com/georgemoralis) **Base:** `main` ← **Head:** `game_folder_fix` --- ### 📝 Commits (10+) - [`85c4805`](https://github.com/shadps4-emu/shadPS4/commit/85c48051f18764350d36650ca37ff0764db88496) fix: game dir dupes on each launch - [`420e4c0`](https://github.com/shadps4-emu/shadPS4/commit/420e4c04add08f18639d779ad13f93a430daa39d) fix copy around settings_addon_install_dir vector - [`70cb429`](https://github.com/shadps4-emu/shadPS4/commit/70cb429bc2d492edeaa53e26d2b416857a5fbc84) do not show the path if it is not added - [`01e39a4`](https://github.com/shadps4-emu/shadPS4/commit/01e39a4e70f4a56d74f12a59dadf80e3f9a83528) remove installDir from config file - [`b0e7c3d`](https://github.com/shadps4-emu/shadPS4/commit/b0e7c3d379967a73681cb5ade56bcaa41236978b) Merge branch 'main' into game_folder_fix - [`0347c72`](https://github.com/shadps4-emu/shadPS4/commit/0347c725c9df13b6c614388abae6c3eb487d7bac) format - [`79f8298`](https://github.com/shadps4-emu/shadPS4/commit/79f82989e74ab951aabfafffd34c0188f59152bf) Merge branch 'main' into game_folder_fix - [`13c1c34`](https://github.com/shadps4-emu/shadPS4/commit/13c1c34c82cb1b57d0316bc21c5e59a5fa1b59b4) moved migration code to save, and added notice - [`fa53fb4`](https://github.com/shadps4-emu/shadPS4/commit/fa53fb42afb6d25829a2156dd230e26eb1d69917) move ui->removeFolderButton->setEnabled to LoadValuesFromConfig - [`4e294dd`](https://github.com/shadps4-emu/shadPS4/commit/4e294ddbf52348b6fb96a665dd5041806854a722) avoid checking duplicates for gameDirs loaded from config ### 📊 Changes **4 files changed** (+32 additions, -40 deletions) <details> <summary>View changed files</summary> 📝 `src/common/config.cpp` (+23 -15) 📝 `src/common/config.h` (+3 -2) 📝 `src/qt_gui/game_install_dialog.cpp` (+1 -4) 📝 `src/qt_gui/settings_dialog.cpp` (+5 -19) </details> ### 📄 Description Well... I think I made this PR too late (originally as a fix of https://github.com/shadps4-emu/shadPS4/issues/1325), so some of the issues have already been fixed, sorry. But here it is. The main reason #1308 duplicates installDir is that the config is not removed from the file. (https://github.com/shadps4-emu/shadPS4/commit/01e39a4e70f4a56d74f12a59dadf80e3f9a83528) Meanwhile, I replaced setGameInstallDirs with addGameInstallDir and removeGameInstallDir so no more duplicated path-adding/removing code, and avoid passing the vectors around; The return value of getGameInstallDirs is made const& so it won't be copied and modified everywhere. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 21:14:59 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shadPS4#2050
No description provided.