mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-17 15:09:03 +02:00
[qt, android] Implement custom save path setting and migration + Implement custom path settings for Android (#3154)
Needs careful review and especially testing Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3154 Reviewed-by: DraVee <dravee@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev> Co-authored-by: kleidis <kleidis1@protonmail.com> Co-committed-by: kleidis <kleidis1@protonmail.com>
This commit is contained in:
parent
18af560a43
commit
b0cd47c005
28 changed files with 867 additions and 24 deletions
|
|
@ -290,6 +290,13 @@ void Config::ReadDataStorageValues() {
|
|||
setPath(EdenPath::DumpDir, "dump_directory");
|
||||
setPath(EdenPath::TASDir, "tas_directory");
|
||||
|
||||
const auto save_dir_setting = ReadStringSetting(std::string("save_directory"));
|
||||
if (save_dir_setting.empty()) {
|
||||
SetEdenPath(EdenPath::SaveDir, GetEdenPathString(EdenPath::NANDDir));
|
||||
} else {
|
||||
SetEdenPath(EdenPath::SaveDir, save_dir_setting);
|
||||
}
|
||||
|
||||
ReadCategory(Settings::Category::DataStorage);
|
||||
|
||||
EndGroup();
|
||||
|
|
@ -583,6 +590,16 @@ void Config::SaveDataStorageValues() {
|
|||
writePath("dump_directory", EdenPath::DumpDir);
|
||||
writePath("tas_directory", EdenPath::TASDir);
|
||||
|
||||
const auto save_path = FS::GetEdenPathString(EdenPath::SaveDir);
|
||||
const auto nand_path = FS::GetEdenPathString(EdenPath::NANDDir);
|
||||
if (save_path == nand_path) {
|
||||
WriteStringSetting(std::string("save_directory"), std::string(""),
|
||||
std::make_optional(std::string("")));
|
||||
} else {
|
||||
WriteStringSetting(std::string("save_directory"), save_path,
|
||||
std::make_optional(std::string("")));
|
||||
}
|
||||
|
||||
WriteCategory(Settings::Category::DataStorage);
|
||||
|
||||
EndGroup();
|
||||
|
|
|
|||
|
|
@ -13,10 +13,11 @@ namespace fs = std::filesystem;
|
|||
const fs::path GetDataDir(DataDir dir, const std::string &user_id)
|
||||
{
|
||||
const fs::path nand_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::NANDDir);
|
||||
const fs::path save_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::SaveDir);
|
||||
|
||||
switch (dir) {
|
||||
case DataDir::Saves:
|
||||
return (nand_dir / "user" / "save" / "0000000000000000" / user_id).string();
|
||||
return (save_dir / "user" / "save" / "0000000000000000" / user_id).string();
|
||||
case DataDir::UserNand:
|
||||
return (nand_dir / "user" / "Contents" / "registered").string();
|
||||
case DataDir::SysNand:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue