config: Added nand_directory and sdmc_directory to Settings

Added settings to the ini
This commit is contained in:
Daniel Méndez 2021-04-17 15:29:12 +02:00
parent 3be52f818a
commit 7f20d8bb88
3 changed files with 22 additions and 12 deletions

View File

@ -201,10 +201,10 @@ void Config::ReadValues() {
// Data Storage // Data Storage
Settings::values.use_virtual_sd = Settings::values.use_virtual_sd =
sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true); sdl2_config->GetBoolean("Data Storage", "use_virtual_sd", true);
Settings::values.nand_dir = Settings::values.nand_dir = sdl2_config->GetString(
sdl2_config->Get("Data Storage", "nand_directory", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)); "Data Storage", "nand_directory", FileUtil::GetUserPath(FileUtil::UserPath::NANDDir));
Settings::values.sdmc_dir = Settings::values.sdmc_dir = sdl2_config->GetString(
sdl2_config->Get("Data Storage", "sdmc_directory", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)); "Data Storage", "sdmc_directory", FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir));
// System // System
Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", true); Settings::values.is_new_3ds = sdl2_config->GetBoolean("System", "is_new_3ds", true);

View File

@ -250,6 +250,14 @@ volume =
# 1 (default): Yes, 0: No # 1 (default): Yes, 0: No
use_virtual_sd = use_virtual_sd =
# The path of the virtual SD card directory.
# empty (default) will use the user_path
sdmc_directory =
# The path of NAND directory.
# empty (default) will use the user_path
nand_directory =
[System] [System]
# The system model that Citra will try to emulate # The system model that Citra will try to emulate
# 0: Old 3DS, 1: New 3DS (default) # 0: Old 3DS, 1: New 3DS (default)

View File

@ -303,13 +303,15 @@ void Config::ReadDataStorageValues() {
Settings::values.use_virtual_sd = ReadSetting(QStringLiteral("use_virtual_sd"), true).toBool(); Settings::values.use_virtual_sd = ReadSetting(QStringLiteral("use_virtual_sd"), true).toBool();
std::string nan_dir = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir); std::string nan_dir = FileUtil::GetUserPath(FileUtil::UserPath::NANDDir);
Settings::values.nand_dir = ReadSetting(QStringLiteral("nand_directory"), QString::fromStdString(nan_dir)) Settings::values.nand_dir =
.toString() ReadSetting(QStringLiteral("nand_directory"), QString::fromStdString(nan_dir))
.toStdString(); .toString()
.toStdString();
std::string sdmc_dir = FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir); std::string sdmc_dir = FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir);
Settings::values.sdmc_dir = ReadSetting(QStringLiteral("sdmc_directory"), QString::fromStdString(sdmc_dir)) Settings::values.sdmc_dir =
.toString() ReadSetting(QStringLiteral("sdmc_directory"), QString::fromStdString(sdmc_dir))
.toStdString(); .toString()
.toStdString();
qt_config->endGroup(); qt_config->endGroup();
} }
@ -861,9 +863,9 @@ void Config::SaveDataStorageValues() {
WriteSetting(QStringLiteral("use_virtual_sd"), Settings::values.use_virtual_sd, true); WriteSetting(QStringLiteral("use_virtual_sd"), Settings::values.use_virtual_sd, true);
WriteSetting(QStringLiteral("nand_directory"), WriteSetting(QStringLiteral("nand_directory"),
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir))); QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::NANDDir)));
WriteSetting(QStringLiteral("sdmc_directory"), WriteSetting(QStringLiteral("sdmc_directory"),
QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir))); QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::SDMCDir)));
qt_config->endGroup(); qt_config->endGroup();
} }