Apply code review changes
This commit is contained in:
@@ -555,11 +555,12 @@ VirtualFile RegisteredCacheUnion::GetEntryUnparsed(RegisteredCacheEntry entry) c
|
|||||||
|
|
||||||
VirtualFile RegisteredCacheUnion::GetEntryRaw(u64 title_id, ContentRecordType type) const {
|
VirtualFile RegisteredCacheUnion::GetEntryRaw(u64 title_id, ContentRecordType type) const {
|
||||||
for (const auto& c : caches) {
|
for (const auto& c : caches) {
|
||||||
if (c != nullptr) {
|
if (c == nullptr) {
|
||||||
const auto res = c->GetEntryRaw(title_id, type);
|
continue;
|
||||||
if (res != nullptr)
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
const auto res = c->GetEntryRaw(title_id, type);
|
||||||
|
if (res != nullptr)
|
||||||
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ const UUID& UUID::Generate() {
|
|||||||
ProfileManager::ProfileManager() {
|
ProfileManager::ProfileManager() {
|
||||||
// TODO(ogniK): Create the default user we have for now until loading/saving users is added
|
// TODO(ogniK): Create the default user we have for now until loading/saving users is added
|
||||||
auto user_uuid = UUID{1, 0};
|
auto user_uuid = UUID{1, 0};
|
||||||
CreateNewUser(user_uuid, Settings::values.username);
|
ASSERT(CreateNewUser(user_uuid, Settings::values.username).IsSuccess());
|
||||||
OpenUser(user_uuid);
|
OpenUser(user_uuid);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -91,9 +91,8 @@ ResultCode ProfileManager::CreateNewUser(UUID uuid, const ProfileUsername& usern
|
|||||||
/// specifically by allowing an std::string for the username. This is required specifically since
|
/// specifically by allowing an std::string for the username. This is required specifically since
|
||||||
/// we're loading a string straight from the config
|
/// we're loading a string straight from the config
|
||||||
ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) {
|
ResultCode ProfileManager::CreateNewUser(UUID uuid, const std::string& username) {
|
||||||
ProfileUsername username_output;
|
ProfileUsername username_output{};
|
||||||
|
|
||||||
ASSERT(username != "");
|
|
||||||
if (username.size() > username_output.size()) {
|
if (username.size() > username_output.size()) {
|
||||||
std::copy_n(username.begin(), username_output.size(), username_output.begin());
|
std::copy_n(username.begin(), username_output.size(), username_output.begin());
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -126,8 +126,9 @@ void Config::ReadValues() {
|
|||||||
// System
|
// System
|
||||||
Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false);
|
Settings::values.use_docked_mode = sdl2_config->GetBoolean("System", "use_docked_mode", false);
|
||||||
Settings::values.username = sdl2_config->Get("System", "username", "yuzu");
|
Settings::values.username = sdl2_config->Get("System", "username", "yuzu");
|
||||||
Settings::values.username =
|
if (Settings::values.username.empty()) {
|
||||||
Settings::values.username == "" ? "yuzu" : Settings::values.username;
|
Settings::values.username = "yuzu";
|
||||||
|
}
|
||||||
|
|
||||||
// Miscellaneous
|
// Miscellaneous
|
||||||
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
Settings::values.log_filter = sdl2_config->Get("Miscellaneous", "log_filter", "*:Trace");
|
||||||
|
|||||||
Reference in New Issue
Block a user