mirror of
https://github.com/citra-emu/citra.git
synced 2024-11-15 07:20:06 +00:00
settings: Save and load NAND/SD dirs from config
This commit is contained in:
parent
b3cab3c450
commit
49c0766b73
@ -201,6 +201,10 @@ void Config::ReadValues() {
|
||||
// Data Storage
|
||||
Settings::values.use_virtual_sd =
|
||||
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
||||
Settings::values.nand_dir =
|
||||
sdl2_config->Get("Data Storage", "nand_directory", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir));
|
||||
Settings::values.sdmc_dir =
|
||||
sdl2_config->Get("Data Storage", "sdmc_directory", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir));
|
||||
|
||||
// System
|
||||
Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", true);
|
||||
|
@ -302,6 +302,14 @@ void Config::ReadDataStorageValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Data Storage"));
|
||||
|
||||
Settings::values.use_virtual_sd = ReadSetting(QStringLiteral("use_virtual_sd"), true).toBool();
|
||||
std::string nan_dir = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
|
||||
Settings::values.nand_dir = ReadSetting(QStringLiteral("nand_directory"), QString::fromStdString(nan_dir))
|
||||
.toString()
|
||||
.toStdString();
|
||||
std::string sdmc_dir = FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir);
|
||||
Settings::values.sdmc_dir = ReadSetting(QStringLiteral("sdmc_directory"), QString::fromStdString(sdmc_dir))
|
||||
.toString()
|
||||
.toStdString();
|
||||
|
||||
qt_config->endGroup();
|
||||
}
|
||||
@ -852,6 +860,10 @@ void Config::SaveDataStorageValues() {
|
||||
qt_config->beginGroup(QStringLiteral("Data Storage"));
|
||||
|
||||
WriteSetting(QStringLiteral("use_virtual_sd"), Settings::values.use_virtual_sd, true);
|
||||
WriteSetting(QStringLiteral("nand_directory"),
|
||||
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)));
|
||||
WriteSetting(QStringLiteral("sdmc_directory"),
|
||||
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)));
|
||||
|
||||
qt_config->endGroup();
|
||||
}
|
||||
|
@ -140,6 +140,8 @@ struct Values {
|
||||
|
||||
// Data Storage
|
||||
bool use_virtual_sd;
|
||||
std::string nand_dir;
|
||||
std::string sdmc_dir;
|
||||
|
||||
// System
|
||||
int region_value;
|
||||
|
Loading…
Reference in New Issue
Block a user