mirror of
https://git.h3cjp.net/H3cJP/citra.git
synced 2024-11-24 10:42:50 +00:00
settings: Save and load NAND/SD dirs from config
This commit is contained in:
parent
9cfe2414cb
commit
b2268f1f8d
|
@ -127,6 +127,8 @@ struct Values {
|
|||
|
||||
// Data Storage
|
||||
bool use_virtual_sd;
|
||||
std::string nand_dir;
|
||||
std::string sdmc_dir;
|
||||
|
||||
// Renderer
|
||||
float resolution_factor;
|
||||
|
|
|
@ -102,6 +102,20 @@ void Config::ReadValues() {
|
|||
|
||||
qt_config->beginGroup("Data Storage");
|
||||
Settings::values.use_virtual_sd = qt_config->value("use_virtual_sd", true).toBool();
|
||||
FileUtil::GetUserPath(
|
||||
FileUtil::UserPath::NANDDir,
|
||||
qt_config
|
||||
->value("nand_directory",
|
||||
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)))
|
||||
.toString()
|
||||
.toStdString());
|
||||
FileUtil::GetUserPath(
|
||||
FileUtil::UserPath::SDMCDir,
|
||||
qt_config
|
||||
->value("sdmc_directory",
|
||||
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)))
|
||||
.toString()
|
||||
.toStdString());
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("System");
|
||||
|
@ -222,6 +236,10 @@ void Config::SaveValues() {
|
|||
|
||||
qt_config->beginGroup("Data Storage");
|
||||
qt_config->setValue("use_virtual_sd", Settings::values.use_virtual_sd);
|
||||
qt_config->setValue("nand_directory",
|
||||
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)));
|
||||
qt_config->setValue("sdmc_directory",
|
||||
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)));
|
||||
qt_config->endGroup();
|
||||
|
||||
qt_config->beginGroup("System");
|
||||
|
|
|
@ -114,6 +114,12 @@ void Config::ReadValues() {
|
|||
// Data Storage
|
||||
Settings::values.use_virtual_sd =
|
||||
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
|
||||
FileUtil::GetUserPath(FileUtil::UserPath::NANDDir,
|
||||
sdl2_config->Get("Data Storage", "nand_directory",
|
||||
FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)));
|
||||
FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir,
|
||||
sdl2_config->Get("Data Storage", "nand_directory",
|
||||
FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)));
|
||||
|
||||
// System
|
||||
Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false);
|
||||
|
|
Loading…
Reference in a new issue